public inbox for linux-staging@lists.linux.dev
 help / color / mirror / Atom feed
* [PATCH v2 1/2] staging: rtl8723bs: fix stainfo check in rtw_aes_decrypt
@ 2026-04-17  9:51 Maksym Pikhotskyi
  2026-04-17  9:51 ` [PATCH v2 2/2] staging: rtl8723bs: reduce nesting in rtw_security.c Maksym Pikhotskyi
  0 siblings, 1 reply; 2+ messages in thread
From: Maksym Pikhotskyi @ 2026-04-17  9:51 UTC (permalink / raw)
  To: gregkh, error27, ethantidmore06, starpt.official, straube.linux,
	sameekshasankpal, arthur.stupa, luka.gejak
  Cc: linux-staging, linux-kernel, Maksym Pikhotskyi

The null-pointer-guard was incorrect, returning _FAIL on valid pointer.
Invert the guard, so it returns _FAIL on invalid pointer.

Fixes: e23ad1570028 ("staging: rtl8723bs: use guard clause for stainfo check")
Reported-by: Luka Gejak <luka.gejak@linux.dev>
Closes: https://lore.kernel.org/linux-staging/E4BF62EF-C6F6-431F-8EDC-77C1E613E66B@linux.dev/
Reviewed-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Maksym Pikhotskyi <mpikhotskyi@gmail.com>
---
v2: rebase on staging-next. Split into a series of patches.
v3: add Reported-by, Closes and Reviewed-by tags.
---
 drivers/staging/rtl8723bs/core/rtw_security.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_security.c b/drivers/staging/rtl8723bs/core/rtw_security.c
index a00504ff2910..f467cb5b1dca 100644
--- a/drivers/staging/rtl8723bs/core/rtw_security.c
+++ b/drivers/staging/rtl8723bs/core/rtw_security.c
@@ -1212,7 +1212,7 @@ u32 rtw_aes_decrypt(struct adapter *padapter, u8 *precvframe)
 	if (prxattrib->encrypt != _AES_)
 		return _SUCCESS;
 	stainfo = rtw_get_stainfo(&padapter->stapriv, &prxattrib->ta[0]);
-	if (stainfo)
+	if (!stainfo)
 		return _FAIL;
 	if (is_multicast_ether_addr(prxattrib->ra)) {
 		static unsigned long start;
-- 
2.51.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-04-17  9:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-17  9:51 [PATCH v2 1/2] staging: rtl8723bs: fix stainfo check in rtw_aes_decrypt Maksym Pikhotskyi
2026-04-17  9:51 ` [PATCH v2 2/2] staging: rtl8723bs: reduce nesting in rtw_security.c Maksym Pikhotskyi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox