mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 03:40:35 +09:00
net: ieee802154: fix a potential NULL pointer dereference
[ Upstream commit 2795e8c251 ]
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>
Signed-off-by: Sasha Levin (Microsoft) <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
a1e34e289e
commit
f722b7789a
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user