From 14d9dad253ef70fd599edf162a12551f713dcf50 Mon Sep 17 00:00:00 2001 From: Nikoloz Bakuradze Date: Wed, 10 Jun 2026 20:47:54 +0400 Subject: [PATCH] staging: rtl8723bs: core: avoid NULL pointer dereference in c2h_wk_callback kmalloc(16, GFP_ATOMIC) in c2h_wk_callback() could in theory return2 NULL, which would then be dereferenced in rtw_hal_c2h_valid(). A 16-byte allocation effectively cannot fail in practice, but add an else continue; to the guard so the failure path exits the iteration cleanly to make the code more robust. Signed-off-by: Nikoloz Bakuradze Reviewed-by: Andy Shevchenko Link: https://patch.msgid.link/20260610164755.49626-1-nbakuradze28@gmail.com Signed-off-by: Greg Kroah-Hartman --- 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 7cec4c64e502..8e2d27b74ea9 100644 --- a/drivers/staging/rtl8723bs/core/rtw_cmd.c +++ b/drivers/staging/rtl8723bs/core/rtw_cmd.c @@ -1714,6 +1714,8 @@ static void c2h_wk_callback(struct work_struct *work) kfree(c2h_evt); continue; } + } else { + continue; } }