Commit 2795e8c2 authored by Kangjie Lu's avatar Kangjie Lu Committed by Stefan Schmidt

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: default avatarKangjie Lu <kjlu@umn.edu>
Acked-by: default avatarMichael Hennerich <michael.hennerich@analog.com>
Signed-off-by: default avatarStefan Schmidt <stefan@datenfreihafen.org>
parent 4ec850e5
...@@ -1268,6 +1268,10 @@ static int adf7242_probe(struct spi_device *spi) ...@@ -1268,6 +1268,10 @@ static int adf7242_probe(struct spi_device *spi)
INIT_DELAYED_WORK(&lp->work, adf7242_rx_cal_work); INIT_DELAYED_WORK(&lp->work, adf7242_rx_cal_work);
lp->wqueue = alloc_ordered_workqueue(dev_name(&spi->dev), lp->wqueue = alloc_ordered_workqueue(dev_name(&spi->dev),
WQ_MEM_RECLAIM); WQ_MEM_RECLAIM);
if (unlikely(!lp->wqueue)) {
ret = -ENOMEM;
goto err_hw_init;
}
ret = adf7242_hw_init(lp); ret = adf7242_hw_init(lp);
if (ret) if (ret)
......
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