[lvc-project] [PATCH] staging: rtl8723bs: Fix NULL pointer dereference in c2h_wk_callback
Roman Demidov
roman.demidov at red-soft.ru
Fri Jul 31 10:00:50 MSK 2026
If the kmalloc function fails to allocate memory, the c2h_evt variable
will be NULL. Its subsequent use in the rtw_hal_c2h_valid() function
will result in a NULL pointer dereference.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Fixes: 554c0a3abf21 ("staging: Add rtl8723bs sdio wifi driver")
Signed-off-by: Roman Demidov <roman.demidov at red-soft.ru>
---
drivers/staging/rtl8723bs/core/rtw_cmd.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/staging/rtl8723bs/core/rtw_cmd.c b/drivers/staging/rtl8723bs/core/rtw_cmd.c
index b932670f5d63..3c1149828718 100644
--- a/drivers/staging/rtl8723bs/core/rtw_cmd.c
+++ b/drivers/staging/rtl8723bs/core/rtw_cmd.c
@@ -1716,6 +1716,8 @@ static void c2h_wk_callback(struct work_struct *work)
kfree(c2h_evt);
continue;
}
+ } else {
+ continue;
}
}
--
2.53.0
More information about the lvc-project
mailing list