Skip to content

Commit

Permalink
net: ieee802154: fix a potential NULL pointer dereference
Browse files Browse the repository at this point in the history
In case alloc_ordered_workqueue fails, the fix releases
sources and returns -ENOMEM to avoid NULL pointer dereference.

Signed-off-by: Kangjie Lu <[email protected]>
Acked-by: Michael Hennerich <[email protected]>
Signed-off-by: Stefan Schmidt <[email protected]>
  • Loading branch information
kengiter authored and Stefan-Schmidt committed Mar 13, 2019
1 parent 4ec850e commit 2795e8c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/net/ieee802154/adf7242.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 2795e8c

Please sign in to comment.