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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 2 Dec 2022 15:32:59 +0530
From:   Pavan Chebbi <pavan.chebbi@...adcom.com>
To:     Qiheng Lin <linqiheng@...wei.com>
Cc:     davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
        pabeni@...hat.com, lars.povlsen@...rochip.com,
        Steen.Hegelund@...rochip.com, daniel.machon@...rochip.com,
        UNGLinuxDriver@...rochip.com, netdev@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] net: microchip: sparx5: Fix missing destroy_workqueue of mact_queue

On Fri, Dec 2, 2022 at 1:36 PM Pavan Chebbi <pavan.chebbi@...adcom.com> wrote:
>
> On Thu, Dec 1, 2022 at 6:57 PM Qiheng Lin <linqiheng@...wei.com> wrote:
> >
> > The mchp_sparx5_probe() won't destroy workqueue created by
> > create_singlethread_workqueue() in sparx5_start() when later
> > inits failed. Add destroy_workqueue in the cleanup_ports case,
> > also add it in mchp_sparx5_remove()
> >
> > Signed-off-by: Qiheng Lin <linqiheng@...wei.com>
> > ---
> >  drivers/net/ethernet/microchip/sparx5/sparx5_main.c | 3 +++
> >  1 file changed, 3 insertions(+)
> >
> > diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_main.c b/drivers/net/ethernet/microchip/sparx5/sparx5_main.c
> > index eeac04b84638..b6bbb3c9bd7a 100644
> > --- a/drivers/net/ethernet/microchip/sparx5/sparx5_main.c
> > +++ b/drivers/net/ethernet/microchip/sparx5/sparx5_main.c
> > @@ -887,6 +887,8 @@ static int mchp_sparx5_probe(struct platform_device *pdev)
> >
> >  cleanup_ports:
> >         sparx5_cleanup_ports(sparx5);
> > +       if (sparx5->mact_queue)
> > +               destroy_workqueue(sparx5->mact_queue);
>
> Would be better if you destroy inside sparx5_start() before returning failure.
>

Alternatively you could add the destroy inside sparx5_cleanup_ports()
that will cover all error exits?

> >  cleanup_config:
> >         kfree(configs);
> >  cleanup_pnode:
> > @@ -911,6 +913,7 @@ static int mchp_sparx5_remove(struct platform_device *pdev)
> >         sparx5_cleanup_ports(sparx5);
> >         /* Unregister netdevs */
> >         sparx5_unregister_notifier_blocks(sparx5);
> > +       destroy_workqueue(sparx5->mact_queue);
> >
> >         return 0;
> >  }
> > --
> > 2.32.0
> >

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