diff options
author | Kangjie Lu <kjlu@umn.edu> | 2019-03-11 02:25:17 -0500 |
---|---|---|
committer | Stefan Schmidt <stefan@datenfreihafen.org> | 2019-03-13 10:07:53 +0100 |
commit | 2795e8c251614ac0784c9d41008551109f665716 (patch) | |
tree | 6fa20e277feb95a133b24ea43f52af2dbc0d41a8 /drivers/net | |
parent | 4ec850e5dfec092b26cf3b7d5a6c9e444ea4babd (diff) | |
download | linux-2795e8c251614ac0784c9d41008551109f665716.tar.bz2 |
net: ieee802154: fix a potential NULL pointer dereference
In case alloc_ordered_workqueue fails, the fix releases
sources and returns -ENOMEM to avoid NULL pointer dereference.
Signed-off-by: Kangjie Lu <kjlu@umn.edu>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Stefan Schmidt <stefan@datenfreihafen.org>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/ieee802154/adf7242.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/ieee802154/adf7242.c b/drivers/net/ieee802154/adf7242.c index cd1d8faccca5..cd6b95e673a5 100644 --- a/drivers/net/ieee802154/adf7242.c +++ b/drivers/net/ieee802154/adf7242.c @@ -1268,6 +1268,10 @@ static int adf7242_probe(struct spi_device *spi) INIT_DELAYED_WORK(&lp->work, adf7242_rx_cal_work); lp->wqueue = alloc_ordered_workqueue(dev_name(&spi->dev), WQ_MEM_RECLAIM); + if (unlikely(!lp->wqueue)) { + ret = -ENOMEM; + goto err_hw_init; + } ret = adf7242_hw_init(lp); if (ret) |