From: Dan Carpenter <dan.carpenter@oracle•com>
To: Johan Hovold <johan@kernel•org>
Cc: Pavel Skripkin <paskripkin@gmail•com>,
aelior@marvell•com, skalluru@marvell•com,
GR-everest-linux-l2@marvell•com, davem@davemloft•net,
kuba@kernel•org, netdev@vger•kernel.org,
linux-kernel@vger•kernel.org
Subject: Re: [PATCH] net: bnx2x: fix variable dereferenced before check
Date: Thu, 18 Nov 2021 18:09:37 +0300 [thread overview]
Message-ID: <20211118150937.GP27562@kadam> (raw)
In-Reply-To: <YZYULWjK34xL6BeW@hovoldconsulting.com>
On Thu, Nov 18, 2021 at 09:51:57AM +0100, Johan Hovold wrote:
> [ Adding Dan. ]
>
> On Sun, Nov 14, 2021 at 01:36:36AM +0300, Pavel Skripkin wrote:
> > Smatch says:
> > bnx2x_init_ops.h:640 bnx2x_ilt_client_mem_op()
> > warn: variable dereferenced before check 'ilt' (see line 638)
> >
> > Move ilt_cli variable initialization _after_ ilt validation, because
> > it's unsafe to deref the pointer before validation check.
>
> It seems smatch is confused here. There is no dereference happening
> until after the check, we're just determining the address when
> initialising ilt_cli.
Yep. You're right. I will fix this. I've written a fix and I'll test
it tonight.
regards,
dan carpenter
prev parent reply other threads:[~2021-11-18 15:10 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-13 22:36 [PATCH] net: bnx2x: fix variable dereferenced before check Pavel Skripkin
2021-11-13 22:41 ` Pavel Skripkin
2021-11-15 14:12 ` Jakub Kicinski
2021-11-15 20:20 ` [PATCH] MAINTAINERS: remove GR-everest-linux-l2@marvell•com Pavel Skripkin
2021-11-16 8:10 ` Alok Prasad
2021-11-16 8:16 ` Alok Prasad
2021-11-16 14:13 ` [PATCH v2] " Pavel Skripkin
2021-11-17 3:10 ` patchwork-bot+netdevbpf
2021-11-15 13:30 ` [PATCH] net: bnx2x: fix variable dereferenced before check patchwork-bot+netdevbpf
2021-11-18 8:51 ` Johan Hovold
2021-11-18 9:00 ` Pavel Skripkin
2021-11-18 15:09 ` Dan Carpenter [this message]
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=20211118150937.GP27562@kadam \
--to=dan.carpenter@oracle$(echo .)com \
--cc=GR-everest-linux-l2@marvell$(echo .)com \
--cc=aelior@marvell$(echo .)com \
--cc=davem@davemloft$(echo .)net \
--cc=johan@kernel$(echo .)org \
--cc=kuba@kernel$(echo .)org \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=netdev@vger$(echo .)kernel.org \
--cc=paskripkin@gmail$(echo .)com \
--cc=skalluru@marvell$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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