Search Linux Wireless

RE: [PATCH v1] drivers: fix the parameter bin reference preceded by free

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




> -----Original Message-----
> From: Minjie Du <duminjie@xxxxxxxx>
> Sent: Thursday, June 1, 2023 3:23 PM
> To: Ping-Ke Shih <pkshih@xxxxxxxxxxx>; kvalo@xxxxxxxxxx
> Cc: linux-wireless@xxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx; Minjie Du <duminjie@xxxxxxxx>
> Subject: [PATCH v1] drivers: fix the parameter bin reference preceded by free

subject prefix should be "wifi: rtw89: fix ... "

> 
> We assign the variable bin to NULL,
> fix variable bin reference preceded by free.
> 
> Signed-off-by: Minjie Du <duminjie@xxxxxxxx>
> ---
>  drivers/net/wireless/realtek/rtw89/debug.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/net/wireless/realtek/rtw89/debug.c b/drivers/net/wireless/realtek/rtw89/debug.c
> index 6f418f14ec3f..4541b4d48e69 100644
> --- a/drivers/net/wireless/realtek/rtw89/debug.c
> +++ b/drivers/net/wireless/realtek/rtw89/debug.c
> @@ -2982,6 +2982,7 @@ static u8 *rtw89_hex2bin_user(struct rtw89_dev *rtwdev,
>         if (hex2bin(bin, buf, num)) {
>                 rtw89_info(rtwdev, "valid format: H1H2H3...\n");
>                 kfree(bin);
> +               bin = NULL;
>                 err = -EINVAL;
>         }


Do you meet real problem? or code checker finds this? 

When 'err' is set, we don't touch 'bin' anymore. 

Ping-Ke





[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux