lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACKFLi=jOqZx-yBBnNFaCOyWTWBKZ=W1KvY2xX-sKAxxOv7kQw@mail.gmail.com>
Date:   Mon, 12 Apr 2021 09:31:33 -0700
From:   Michael Chan <michael.chan@...adcom.com>
To:     Leon Romanovsky <leon@...nel.org>
Cc:     David Miller <davem@...emloft.net>,
        Netdev <netdev@...r.kernel.org>,
        Jakub Kicinski <kuba@...nel.org>,
        Andrew Gospodarek <gospo@...adcom.com>,
        Sriharsha Basavapatna <sriharsha.basavapatna@...adcom.com>
Subject: Re: [PATCH net-next 4/5] bnxt_en: Refactor __bnxt_vf_reps_destroy().

On Mon, Apr 12, 2021 at 12:37 AM Leon Romanovsky <leon@...nel.org> wrote:
>
> On Sun, Apr 11, 2021 at 08:18:14PM -0400, Michael Chan wrote:
> > Add a new helper function __bnxt_free_one_vf_rep() to free one VF rep.
> > We also reintialize the VF rep fields to proper initial values so that
> > the function can be used without freeing the VF rep data structure.  This
> > will be used in subsequent patches to free and recreate VF reps after
> > error recovery.
> >
> > Reviewed-by: Edwin Peer <edwin.peer@...adcom.com>
> > Reviewed-by: Sriharsha Basavapatna <sriharsha.basavapatna@...adcom.com>
> > Signed-off-by: Michael Chan <michael.chan@...adcom.com>
> > ---
> >  drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c | 21 ++++++++++++++-----
> >  1 file changed, 16 insertions(+), 5 deletions(-)
> >
> > diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c
> > index b5d6cd63bea7..a4ac11f5b0e5 100644
> > --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c
> > +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c
> > @@ -288,6 +288,21 @@ void bnxt_vf_reps_open(struct bnxt *bp)
> >               bnxt_vf_rep_open(bp->vf_reps[i]->dev);
> >  }
> >
> > +static void __bnxt_free_one_vf_rep(struct bnxt *bp, struct bnxt_vf_rep *vf_rep)
> > +{
> > +     if (!vf_rep)
> > +             return;
>
> How can it be NULL if you check that vf_rep != NULL when called to
> __bnxt_free_one_vf_rep() ?
>

For this patch, the if (!vf_rep) check here is redundant.  But it is
needed in the next patch (patch 5) that calls this function from
bnxt_vf_reps_free() in a different context.  Thanks.

Download attachment "smime.p7s" of type "application/pkcs7-signature" (4209 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ