]> git.hungrycats.org Git - linux/commit
staging: rtl8723bs: os_dep: avoid NULL pointer dereference in rtw_cbuf_alloc
authorShyam Sunder Reddy Padira <shyamsunderreddypadira@gmail.com>
Tue, 14 Apr 2026 07:13:06 +0000 (12:43 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 14 Sep 2026 11:36:19 +0000 (13:36 +0200)
commit7d4024037ee309a8f0cb86b4093d59da0e135db8
tree792937c1b02a29422fdd32064f454af8a41d1f29
parent7bca33d6f6e00ea7f9c31bffbfecd4f2713fb2cb
staging: rtl8723bs: os_dep: avoid NULL pointer dereference in rtw_cbuf_alloc

commit bc851db06045a40c18233dd76ef0562d7f8bb6db upstream.

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: 980cd426a257 ("staging: rtl8723bs: replace rtw_zmalloc() with kzalloc()")
Cc: stable <stable@kernel.org>
Signed-off-by: Shyam Sunder Reddy Padira <shyamsunderreddypadira@gmail.com>
Reviewed-by: Dan Carpenter <error27@gmail.com>
Link: https://patch.msgid.link/20260414071308.4781-2-shyamsunderreddypadira@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8723bs/os_dep/osdep_service.c