From: Dan Carpenter <dan.carpenter@linaro.org>
To: Paolo Abeni <pabeni@redhat.com>
Cc: Markus Elfring <Markus.Elfring@web.de>,
linuxppc-dev@lists.ozlabs.org, netdev@vger.kernel.org,
kernel-janitors@vger.kernel.org,
"Aneesh Kumar K.V" <aneesh.kumar@kernel.org>,
Christophe Leroy <christophe.leroy@csgroup.eu>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Haren Myneni <haren@linux.ibm.com>,
Jakub Kicinski <kuba@kernel.org>,
Michael Ellerman <mpe@ellerman.id.au>,
"Naveen N. Rao" <naveen.n.rao@linux.ibm.com>,
Nicholas Piggin <npiggin@gmail.com>,
Nick Child <nnac123@linux.ibm.com>,
Rick Lindsley <ricklind@linux.ibm.com>,
Thomas Falcon <tlfalcon@linux.ibm.com>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] ibmvnic: Use -EBUSY in __ibmvnic_reset()
Date: Tue, 23 Apr 2024 14:55:10 +0300 [thread overview]
Message-ID: <da19d324-3c66-4bb1-8fa2-dc26dbea622b@moroto.mountain> (raw)
In-Reply-To: <f493e39063ee52a3d263de27bfd240149d910a88.camel@redhat.com>
On Tue, Apr 23, 2024 at 12:54:55PM +0200, Paolo Abeni wrote:
> On Fri, 2024-04-19 at 16:08 +0200, Markus Elfring wrote:
> > From: Markus Elfring <elfring@users.sourceforge.net>
> > Date: Fri, 19 Apr 2024 15:46:17 +0200
> >
> > Add a minus sign before the error code “EBUSY”
> > so that a negative value will be used as in other cases.
> >
> > This issue was transformed by using the Coccinelle software.
> >
> > Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> > ---
> > drivers/net/ethernet/ibm/ibmvnic.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c
> > index 5e9a93bdb518..737ae83a836a 100644
> > --- a/drivers/net/ethernet/ibm/ibmvnic.c
> > +++ b/drivers/net/ethernet/ibm/ibmvnic.c
> > @@ -3212,7 +3212,7 @@ static void __ibmvnic_reset(struct work_struct *work)
> > adapter->state == VNIC_REMOVED) {
> > spin_unlock_irqrestore(&adapter->state_lock, flags);
> > kfree(rwi);
> > - rc = EBUSY;
> > + rc = -EBUSY;
> > break;
> >
>
> AFAICS the error is always used as bool, so this will not change any
> behavior in practice. I tend to think we should not merge this kind of
> change outside some larger work in the same area, but I'd love a second
> opinion from the driver owners.
I missed the original patch due to my procmail filters...
You're right that it doesn't affect the behavior of the driver except
for the debug output when we do:
netdev_dbg(adapter->netdev, "Reset failed, rc=%d\n", rc);
But the - was left off uninitentionally so I think we should apply it.
I have been trying to look for similar bugs where the - is left off.
It's a bit challenging because there places where we use positive
error codes deliberately. But in this case a static checker could
easily detect the bug with a low false positive ratio by saying, "We're
mixing normal negative error codes with positive EBUSY".
regards,
dan carpenter
next prev parent reply other threads:[~2024-04-23 11:55 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-19 14:08 [PATCH] ibmvnic: Use -EBUSY in __ibmvnic_reset() Markus Elfring
2024-04-23 10:54 ` Paolo Abeni
2024-04-23 11:55 ` Dan Carpenter [this message]
2024-04-23 14:55 ` Nick Child
2024-04-23 15:41 ` Dan Carpenter
2024-04-25 2:32 ` Jakub Kicinski
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=da19d324-3c66-4bb1-8fa2-dc26dbea622b@moroto.mountain \
--to=dan.carpenter@linaro.org \
--cc=Markus.Elfring@web.de \
--cc=aneesh.kumar@kernel.org \
--cc=christophe.leroy@csgroup.eu \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=haren@linux.ibm.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=naveen.n.rao@linux.ibm.com \
--cc=netdev@vger.kernel.org \
--cc=nnac123@linux.ibm.com \
--cc=npiggin@gmail.com \
--cc=pabeni@redhat.com \
--cc=ricklind@linux.ibm.com \
--cc=tlfalcon@linux.ibm.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