From: Andy Shevchenko <andy@kernel.org>
To: Abraham Samuel Adekunle <abrahamadekunle50@gmail.com>
Cc: julia.lawall@inria.fr, gregkh@linuxfoundation.org,
linux-kernel@vger.kernel.org, linux-staging@lists.linux.dev,
dan.carpenter@linaro.org
Subject: Re: [PATCH v6 1/2] staging: rtl8723bs: Remove duplicate NULL tests on pstat
Date: Sat, 19 Apr 2025 19:23:49 +0300 [thread overview]
Message-ID: <aAPOFccMEWDHjJ_S@smile.fi.intel.com> (raw)
In-Reply-To: <016d5429e5db0596a4fc8bb25b1c23ff94ff88b4.1744990405.git.abrahamadekunle50@gmail.com>
On Fri, Apr 18, 2025 at 03:41:56PM +0000, Abraham Samuel Adekunle wrote:
> The pstat pointer has been previously tested for NULL after being
> initialized as seen from line 970-973 of the file.
> The first NULL test is shown below:
> pstat = rtw_get_stainfo(pstapriv, GetAddr2Ptr(pframe));
> if (!pstat) {
> status = WLAN_REASON_CLASS2_FRAME_FROM_NONAUTH_STA;
> goto asoc_class2_error;
> }
It's too much for such a change. You can do that in the comment area
(after '---' line below), or drop it completely. You can rephrase that
the pointer is checked before the changed lines.
> Remove the second NULL test to avoid redundancy in code.
>
> Found by Coccinelle
Missing period.
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2025-04-19 16:23 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-18 15:41 [PATCH v6 0/2] Cleanup duplicate NULL tests on a value Abraham Samuel Adekunle
2025-04-18 15:41 ` [PATCH v6 1/2] staging: rtl8723bs: Remove duplicate NULL tests on pstat Abraham Samuel Adekunle
2025-04-19 16:23 ` Andy Shevchenko [this message]
2025-04-18 15:41 ` [PATCH v6 2/2] staging: rtl8723bs: Prevent duplicate NULL tests on psta pointer Abraham Samuel Adekunle
2025-04-19 16:25 ` Andy Shevchenko
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=aAPOFccMEWDHjJ_S@smile.fi.intel.com \
--to=andy@kernel.org \
--cc=abrahamadekunle50@gmail.com \
--cc=dan.carpenter@linaro.org \
--cc=gregkh@linuxfoundation.org \
--cc=julia.lawall@inria.fr \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.