lkml.org 
[lkml]   [2022]   [Apr]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] staging: r8188eu: Remove goto to no-op exit label
Date
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



\
 
 \ /
  Last update: 2022-04-02 15:23    [W:2.440 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site