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

From: Minjie Du
Date: Thu Jun 01 2023 - 03:23:47 EST


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;
}

--
2.25.1


________________________________
本邮件及其附件内容可能含有机密和/或隐私信息,仅供指定个人或机构使用。若您非发件人指定收件人或其代理人,请勿使用、传播、复制或存储此邮件之任何内容或其附件。如您误收本邮件,请即以回复或电话方式通知发件人,并将原始邮件、附件及其所有复本删除。谢谢。
The contents of this message and any attachments may contain confidential and/or privileged information and are intended exclusively for the addressee(s). If you are not the intended recipient of this message or their agent, please note that any use, dissemination, copying, or storage of this message or its attachments is not allowed. If you receive this message in error, please notify the sender by reply the message or phone and delete this message, any attachments and any copies immediately.
Thank you