netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] ieee802154: fix one possible memleak in ca8210_dev_com_init
@ 2020-07-20 14:33 Liu Jian
  2020-07-21  8:35 ` Stefan Schmidt
  0 siblings, 1 reply; 3+ messages in thread
From: Liu Jian @ 2020-07-20 14:33 UTC (permalink / raw)
  To: h.morris, alex.aring, stefan, davem, kuba, marcel, netdev

We should call destroy_workqueue to destroy mlme_workqueue in error branch.

Fixes: ded845a781a5 ("ieee802154: Add CA8210 IEEE 802.15.4 device driver")
Signed-off-by: Liu Jian <liujian56@huawei.com>
---
 drivers/net/ieee802154/ca8210.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ieee802154/ca8210.c b/drivers/net/ieee802154/ca8210.c
index e04c3b60cae7..4eb64709d44c 100644
--- a/drivers/net/ieee802154/ca8210.c
+++ b/drivers/net/ieee802154/ca8210.c
@@ -2925,6 +2925,7 @@ static int ca8210_dev_com_init(struct ca8210_priv *priv)
 	);
 	if (!priv->irq_workqueue) {
 		dev_crit(&priv->spi->dev, "alloc of irq_workqueue failed!\n");
+		destroy_workqueue(priv->mlme_workqueue);
 		return -ENOMEM;
 	}
 
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net] ieee802154: fix one possible memleak in ca8210_dev_com_init
  2020-07-20 14:33 [PATCH net] ieee802154: fix one possible memleak in ca8210_dev_com_init Liu Jian
@ 2020-07-21  8:35 ` Stefan Schmidt
  2020-07-21 11:09   ` liujian (CE)
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Schmidt @ 2020-07-21  8:35 UTC (permalink / raw)
  To: Liu Jian, h.morris, alex.aring, davem, kuba, marcel, netdev

Hello.

On 20.07.20 16:33, Liu Jian wrote:
> We should call destroy_workqueue to destroy mlme_workqueue in error branch.
> 
> Fixes: ded845a781a5 ("ieee802154: Add CA8210 IEEE 802.15.4 device driver")
> Signed-off-by: Liu Jian <liujian56@huawei.com>
> ---
>   drivers/net/ieee802154/ca8210.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/net/ieee802154/ca8210.c b/drivers/net/ieee802154/ca8210.c
> index e04c3b60cae7..4eb64709d44c 100644
> --- a/drivers/net/ieee802154/ca8210.c
> +++ b/drivers/net/ieee802154/ca8210.c
> @@ -2925,6 +2925,7 @@ static int ca8210_dev_com_init(struct ca8210_priv *priv)
>   	);
>   	if (!priv->irq_workqueue) {
>   		dev_crit(&priv->spi->dev, "alloc of irq_workqueue failed!\n");
> +		destroy_workqueue(priv->mlme_workqueue);
>   		return -ENOMEM;
>   	}

For ieee802154 patches please keep the linux-wpan list in CC. This 
allows me to track patches with patchwork. Applied this one manually.

This patch has been applied to the wpan tree and will be
part of the next pull request to net. Thanks!

regards
Stefan Schmidt

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [PATCH net] ieee802154: fix one possible memleak in ca8210_dev_com_init
  2020-07-21  8:35 ` Stefan Schmidt
@ 2020-07-21 11:09   ` liujian (CE)
  0 siblings, 0 replies; 3+ messages in thread
From: liujian (CE) @ 2020-07-21 11:09 UTC (permalink / raw)
  To: Stefan Schmidt, h.morris, alex.aring, davem, kuba, marcel, netdev



> -----Original Message-----
> From: Stefan Schmidt [mailto:stefan@datenfreihafen.org]
> Sent: Tuesday, July 21, 2020 4:35 PM
> To: liujian (CE) <liujian56@huawei.com>; h.morris@cascoda.com;
> alex.aring@gmail.com; davem@davemloft.net; kuba@kernel.org;
> marcel@holtmann.or; netdev@vger.kernel.org
> Subject: Re: [PATCH net] ieee802154: fix one possible memleak in
> ca8210_dev_com_init
> 
> Hello.
> 
> On 20.07.20 16:33, Liu Jian wrote:
> > We should call destroy_workqueue to destroy mlme_workqueue in error
> branch.
> >
> > Fixes: ded845a781a5 ("ieee802154: Add CA8210 IEEE 802.15.4 device
> > driver")
> > Signed-off-by: Liu Jian <liujian56@huawei.com>
> > ---
> >   drivers/net/ieee802154/ca8210.c | 1 +
> >   1 file changed, 1 insertion(+)
> >
> > diff --git a/drivers/net/ieee802154/ca8210.c
> > b/drivers/net/ieee802154/ca8210.c index e04c3b60cae7..4eb64709d44c
> > 100644
> > --- a/drivers/net/ieee802154/ca8210.c
> > +++ b/drivers/net/ieee802154/ca8210.c
> > @@ -2925,6 +2925,7 @@ static int ca8210_dev_com_init(struct ca8210_priv
> *priv)
> >   	);
> >   	if (!priv->irq_workqueue) {
> >   		dev_crit(&priv->spi->dev, "alloc of irq_workqueue
> failed!\n");
> > +		destroy_workqueue(priv->mlme_workqueue);
> >   		return -ENOMEM;
> >   	}
> 
> For ieee802154 patches please keep the linux-wpan list in CC. This allows me
> to track patches with patchwork. Applied this one manually.
Got it, thank you~
> This patch has been applied to the wpan tree and will be part of the next pull
> request to net. Thanks!
> 
> regards
> Stefan Schmidt

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-07-21 11:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-20 14:33 [PATCH net] ieee802154: fix one possible memleak in ca8210_dev_com_init Liu Jian
2020-07-21  8:35 ` Stefan Schmidt
2020-07-21 11:09   ` liujian (CE)

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).