projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
473309f
)
ieee802154: fix one possible memleak in adf7242_probe
author
Liu Jian
<liujian56@huawei.com>
Fri, 17 Jul 2020 09:01:21 +0000
(17:01 +0800)
committer
Stefan Schmidt
<stefan@datenfreihafen.org>
Fri, 17 Jul 2020 09:31:08 +0000
(11:31 +0200)
When probe fail, we should destroy the workqueue.
Fixes:
2795e8c25161
("net: ieee802154: fix a potential NULL pointer dereference")
Signed-off-by: Liu Jian <liujian56@huawei.com>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
Link:
https://lore.kernel.org/r/20200717090121.2143-1-liujian56@huawei.com
Signed-off-by: Stefan Schmidt <stefan@datenfreihafen.org>
drivers/net/ieee802154/adf7242.c
patch
|
blob
|
history
diff --git
a/drivers/net/ieee802154/adf7242.c
b/drivers/net/ieee802154/adf7242.c
index
5a37514
..
8dbccec
100644
(file)
--- a/
drivers/net/ieee802154/adf7242.c
+++ b/
drivers/net/ieee802154/adf7242.c
@@
-1262,7
+1262,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);
@@
-1294,6
+1294,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);