public inbox for linux-staging@lists.linux.dev
 help / color / mirror / Atom feed
From: Maksym Pikhotskyi <mpikhotskyi@gmail.com>
To: gregkh@linuxfoundation.org, ethantidmore06@gmail.com,
	starpt.official@gmail.com, straube.linux@gmail.com,
	sameekshasankpal@gmail.com, arthur.stupa@gmail.com,
	luka.gejak@linux.dev
Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
	Maksym Pikhotskyi <mpikhotskyi@gmail.com>
Subject: [PATCH v2 1/2] staging: rtl8723bs: fix stainfo check in rtw_aes_decrypt
Date: Thu, 16 Apr 2026 23:53:37 +0400	[thread overview]
Message-ID: <20260416195338.324428-1-mpikhotskyi@gmail.com> (raw)
In-Reply-To: <20260415184727.285753-1-mpikhotskyi@gmail.com>

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")
Signed-off-by: Maksym Pikhotskyi <mpikhotskyi@gmail.com>
---
 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


  parent reply	other threads:[~2026-04-16 19:53 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-15 18:47 [PATCH] staging: r8723bs: reduce nesting Maksym Pikhotskyi
2026-04-16 11:20 ` Luka Gejak
2026-04-16 19:53 ` Maksym Pikhotskyi [this message]
2026-04-16 19:53   ` [PATCH v2 2/2] staging: rtl8723bs: " Maksym Pikhotskyi
2026-04-16 20:58     ` Luka Gejak
2026-04-16 20:42   ` [PATCH v2 1/2] staging: rtl8723bs: fix stainfo check in rtw_aes_decrypt Luka Gejak
2026-04-16 21:19     ` Dan Carpenter
2026-04-16 21:11   ` Dan Carpenter
2026-04-16 21:13   ` Dan Carpenter
  -- strict thread matches above, loose matches on Subject: below --
2026-04-17  9:51 Maksym Pikhotskyi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260416195338.324428-1-mpikhotskyi@gmail.com \
    --to=mpikhotskyi@gmail.com \
    --cc=arthur.stupa@gmail.com \
    --cc=ethantidmore06@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=luka.gejak@linux.dev \
    --cc=sameekshasankpal@gmail.com \
    --cc=starpt.official@gmail.com \
    --cc=straube.linux@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox