Commit 5b42dd75 authored by Liu Jian's avatar Liu Jian Committed by Greg Kroah-Hartman

ieee802154: fix one possible memleak in adf7242_probe

[ Upstream commit 66673f96 ]

When probe fail, we should destroy the workqueue.

Fixes: 2795e8c2 ("net: ieee802154: fix a potential NULL pointer dereference")
Signed-off-by: default avatarLiu Jian <liujian56@huawei.com>
Acked-by: default avatarMichael Hennerich <michael.hennerich@analog.com>
Link: https://lore.kernel.org/r/20200717090121.2143-1-liujian56@huawei.comSigned-off-by: default avatarStefan Schmidt <stefan@datenfreihafen.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 4adc5fb3
......@@ -1270,7 +1270,7 @@ static int adf7242_probe(struct spi_device *spi)
WQ_MEM_RECLAIM);
if (unlikely(!lp->wqueue)) {
ret = -ENOMEM;
goto err_hw_init;
goto err_alloc_wq;
}
ret = adf7242_hw_init(lp);
......@@ -1302,6 +1302,8 @@ static int adf7242_probe(struct spi_device *spi)
return ret;
err_hw_init:
destroy_workqueue(lp->wqueue);
err_alloc_wq:
mutex_destroy(&lp->bmux);
ieee802154_free_hw(lp->hw);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment