From: Dan Carpenter <dan.carpenter@linaro.org>
To: Siva Reddy Kallam <siva.kallam@broadcom.com>
Cc: leonro@nvidia.com, jgg@nvidia.com, linux-rdma@vger.kernel.org,
Simon Horman <horms@kernel.org>,
kernel test robot <lkp@intel.com>,
Dan Carpenter <error27@gmail.com>,
Usman Ansari <usman.ansari@broadcom.com>
Subject: Re: [v2] RDMA/bng_re: Unwind bng_re_dev_init properly and remove unnecessary rdev check
Date: Tue, 20 Jan 2026 12:07:29 +0300 [thread overview]
Message-ID: <aW9F0QZ5E-VaENOO@stanley.mountain> (raw)
In-Reply-To: <20260120090204.635526-1-siva.kallam@broadcom.com>
On Tue, Jan 20, 2026 at 09:02:04AM +0000, Siva Reddy Kallam wrote:
> Fix below smatch warnings:
> drivers/infiniband/hw/bng_re/bng_dev.c:113
> bng_re_net_ring_free() warn: variable dereferenced before check 'rdev'
> (see line 107)
> drivers/infiniband/hw/bng_re/bng_dev.c:270
> bng_re_dev_init() warn: missing unwind goto?
I would probably split this into two patches, one to remove the NULL
checks and one to fix the unwinding. I would say that even though
removing the NULL checks doesn't fix a real life bug, it's probably
still worth having a Fixes tag because otherwise if this is backported
to an older kernel it will trigger the warning again and we'll have
to review it again. Where if it has a fixes tag, the cleanup will be
backported as well.
>
> The first warning is due to accessing rdev before validity check in
> bng_re_net_ring_free.So, removed unnecessary rdev check in
> bng_re_net_ring_free.
> The smatch also flagged about unwinding bng_re_dev_init. So, added proper
> unwinding ladder in bng_re_dev_init.
>
> ------
> Changes from:
> v1->v2
> Addressed the following comments by Leon Romanovsky:
> - provide proper commit message
> - remove aux_dev check in bng_re_net_ring_free
> - remove uncessary validity checks in driver paths
> - remove uncessary NULL assignment to rdev->nqr in bng_re_dev_init.
> --------
>
This isn't the right way to send a v2 patch. I have written a blog
which explains more.
https://staticthinking.wordpress.com/2022/07/27/how-to-send-a-v2-patch/
> Fixes: 4f830cd8d7fe ("RDMA/bng_re: Add infrastructure for enabling Firmware channel")
> Reported-by: Simon Horman <horms@kernel.org>
> Reported-by: kernel test robot <lkp@intel.com>
> Reported-by: Dan Carpenter <error27@gmail.com>
> Closes: https://lore.kernel.org/r/202601010413.sWadrQel-lkp@intel.com/
> Signed-off-by: Siva Reddy Kallam <siva.kallam@broadcom.com>
> Reviewed-by: Usman Ansari <usman.ansari@broadcom.com>
> ---
> drivers/infiniband/hw/bng_re/bng_dev.c | 56 +++++++++-----------------
> 1 file changed, 19 insertions(+), 37 deletions(-)
>
regards,
dan carpenter
next prev parent reply other threads:[~2026-01-20 9:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-20 9:02 [v2] RDMA/bng_re: Unwind bng_re_dev_init properly and remove unnecessary rdev check Siva Reddy Kallam
2026-01-20 9:07 ` Dan Carpenter [this message]
2026-01-20 9:11 ` Siva Reddy Kallam
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=aW9F0QZ5E-VaENOO@stanley.mountain \
--to=dan.carpenter@linaro.org \
--cc=error27@gmail.com \
--cc=horms@kernel.org \
--cc=jgg@nvidia.com \
--cc=leonro@nvidia.com \
--cc=linux-rdma@vger.kernel.org \
--cc=lkp@intel.com \
--cc=siva.kallam@broadcom.com \
--cc=usman.ansari@broadcom.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