Re: [PATCH v2] staging: rtl8723bs: os_dep: avoid NULL pointer dereference in rtw_cbuf_alloc
From: Dan Carpenter
Date: Tue Apr 14 2026 - 02:01:29 EST
On Tue, Apr 14, 2026 at 04:14:17AM +0530, Shyam Sunder Reddy Padira wrote:
> The return value of kzalloc_flex() is used without
> ensuring that the allocation succeeded, and the
> pointer is dereferenced unconditionally.
>
> Guard the access to the allocated structure to
> avoid a potential NULL pointer dereference if the
> allocation fails.
>
> Fixes: 980cd426a25747daf8ed25e2a1904b2d26ffbb3d ("staging: rtl8723bs: replace rtw_zmalloc() with kzalloc()")
>
> Signed-off-by: Shyam Sunder Reddy Padira <shyamsunderreddypadira@xxxxxxxxx>
> ---
> changes in v2:
> -Fixed spelling mistakes(dereference, potential)
> -Added Fixes tag
It should be a 12 char hash:
Fixes: 980cd426a257 ("staging: rtl8723bs: replace rtw_zmalloc() with kzalloc()")
Remove the blank line between the Fixes tag and the Signed-off-by line.
regards,
dan carpenter