lkml.org 
[lkml]   [2022]   [Mar]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] net/mlx5e: Fix return of a kfree'd object instead of NULL
On 24 Feb 22:15, Colin Ian King wrote:
>Currently in the case where parse_attr fails to be allocated the memory
>pointed to by attr2 is kfree'd but the non-null pointer attr2 is returned
>and a potential use of a kfree'd object can occur. Fix this by returning
>NULL to indicate a memory allocation error.
>
>Addresses issue found by clang-scan:
>drivers/net/ethernet/mellanox/mlx5/core/en_tc.c:3401:3: warning: Use of
>memory after it is freed [unix.Malloc]
>
>Fixes: 8300f225268b ("net/mlx5e: Create new flow attr for multi table actions")
>Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Applied to net-next-mlx5
Thanks.

\
 
 \ /
  Last update: 2022-03-01 08:12    [W:1.095 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site