From: "Fabio M. De Francesco" <fmdefrancesco@gmail.com>
To: Martin Kaiser <martin@kaiser.cx>
Cc: Ira Weiny <ira.weiny@intel.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Larry Finger <Larry.Finger@lwfinger.net>,
Phillip Potter <phil@philpotter.co.uk>,
linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
outreachy@lists.linux.dev
Subject: Re: [PATCH] staging: r8188eu: Remove goto to no-op exit label
Date: Sat, 02 Apr 2022 15:22:23 +0200 [thread overview]
Message-ID: <2108195.Mh6RI2rZIc@leap> (raw)
In-Reply-To: <Ykg3Xfb4vjjGSyKc@martin-debian-2.paytec.ch>
On sabato 2 aprile 2022 13:45:33 CEST Martin Kaiser wrote:
> Thus wrote Fabio M. De Francesco (fmdefrancesco@gmail.com):
>
> > > > pnpi = netdev_priv(netdev);
>
> > > > if (!pnpi->priv)
> > > > - goto RETURN;
> > > > + return;
>
> > I cannot see how pnpi->priv might ever be NULL.
>
> Even if pnpi->priv was NULL, we wouldn't need the check. It's ok to call
> vfree(NULL).
>
> > After the two removals I've talked about above, the code will always call
> > vfree(pnpi->priv) and then free_netdev(netdev).
>
> That makes sense.
>
> Best regards,
> Martin
>
Hi Martin,
Thanks for reminding to me that a vfree() on a NULL pointer is a no-op.
I'm going to submit a new patch with the purpose to re-work rtw_free_netdev().
Thanks again,
Fabio
next prev parent reply other threads:[~2022-04-02 13:22 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-01 18:35 [PATCH] staging: r8188eu: Remove goto to no-op exit label Fabio M. De Francesco
2022-04-01 20:41 ` Ira Weiny
2022-04-02 10:13 ` Fabio M. De Francesco
2022-04-02 11:45 ` Martin Kaiser
2022-04-02 13:22 ` Fabio M. De Francesco [this message]
2022-04-04 9:59 ` Dan Carpenter
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=2108195.Mh6RI2rZIc@leap \
--to=fmdefrancesco@gmail.com \
--cc=Larry.Finger@lwfinger.net \
--cc=gregkh@linuxfoundation.org \
--cc=ira.weiny@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=martin@kaiser.cx \
--cc=outreachy@lists.linux.dev \
--cc=phil@philpotter.co.uk \
/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;
as well as URLs for NNTP newsgroup(s).