* [PATCH] libertas: fix a potential NULL pointer dereference
@ 2019-09-18 16:35 Allen Pais
2019-10-01 9:22 ` Kalle Valo
0 siblings, 1 reply; 2+ messages in thread
From: Allen Pais @ 2019-09-18 16:35 UTC (permalink / raw)
To: netdev; +Cc: davem, kvalo, libertas-dev, linux-wireless, linux-kernel
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>
---
drivers/net/wireless/marvell/libertas/if_sdio.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/net/wireless/marvell/libertas/if_sdio.c b/drivers/net/wireless/marvell/libertas/if_sdio.c
index 242d884..30f1025 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 @@ static int if_sdio_probe(struct sdio_func *func,
lbs_remove_card(priv);
free:
destroy_workqueue(card->workqueue);
+err_queue:
while (card->packets) {
packet = card->packets;
card->packets = card->packets->next;
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] libertas: fix a potential NULL pointer dereference
2019-09-18 16:35 [PATCH] libertas: fix a potential NULL pointer dereference Allen Pais
@ 2019-10-01 9:22 ` Kalle Valo
0 siblings, 0 replies; 2+ messages in thread
From: Kalle Valo @ 2019-10-01 9:22 UTC (permalink / raw)
To: Allen Pais; +Cc: netdev, davem, libertas-dev, linux-wireless, linux-kernel
Allen Pais <allen.pais@oracle.com> wrote:
> 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>
Patch applied to wireless-drivers-next.git, thanks.
7da413a18583 libertas: fix a potential NULL pointer dereference
--
https://patchwork.kernel.org/patch/11150757/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-10-01 9:22 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-18 16:35 [PATCH] libertas: fix a potential NULL pointer dereference Allen Pais
2019-10-01 9:22 ` Kalle Valo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).