diff options
author | Allen Pais <allen.pais@oracle.com> | 2019-09-18 22:05:00 +0530 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2019-10-01 12:21:37 +0300 |
commit | 7da413a18583baaf35dd4a8eb414fa410367d7f2 (patch) | |
tree | 577b64dc9fc6c32fe33cd0526bc72d6a9fd71cf9 /drivers/net/wireless/marvell | |
parent | a0d46f7a0fa5e2a447a25c87612040babf7a3e18 (diff) |
libertas: fix a potential NULL pointer dereference
alloc_workqueue is not checked for errors and as a result,
a potential NULL dereference could occur.
Signed-off-by: Allen Pais <allen.pais@oracle.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/marvell')
-rw-r--r-- | drivers/net/wireless/marvell/libertas/if_sdio.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/wireless/marvell/libertas/if_sdio.c b/drivers/net/wireless/marvell/libertas/if_sdio.c index 242d8845da3f..30f1025ecb9b 100644 --- a/drivers/net/wireless/marvell/libertas/if_sdio.c +++ b/drivers/net/wireless/marvell/libertas/if_sdio.c @@ -1179,6 +1179,10 @@ static int if_sdio_probe(struct sdio_func *func, spin_lock_init(&card->lock); card->workqueue = alloc_workqueue("libertas_sdio", WQ_MEM_RECLAIM, 0); + if (unlikely(!card->workqueue)) { + ret = -ENOMEM; + goto err_queue; + } INIT_WORK(&card->packet_worker, if_sdio_host_to_card_worker); init_waitqueue_head(&card->pwron_waitq); @@ -1230,6 +1234,7 @@ err_activate_card: lbs_remove_card(priv); free: destroy_workqueue(card->workqueue); +err_queue: while (card->packets) { packet = card->packets; card->packets = card->packets->next; |