提交 7a801744 编写于 作者: Y Yang Yingliang 提交者: Xie XiuQi

libertas: check workqueue in if_sdio_probe()

hulk inclusion
category: bugfix
bugzilla: 13690
CVE: CVE-2019-16232

-------------------------------------------------

There are multiple points in the Linux Kernel where alloc_workqueue is
not getting checked for errors and as a result, a potential NULL
dereference could occur.
https://lkml.org/lkml/2019/9/9/487Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
Reviewed-by: NWenan Mao <maowenan@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 db2d4fdb
......@@ -1183,6 +1183,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 (!card->workqueue) {
ret = -ENOMEM;
goto free_before_queue;
}
INIT_WORK(&card->packet_worker, if_sdio_host_to_card_worker);
init_waitqueue_head(&card->pwron_waitq);
......@@ -1234,6 +1238,7 @@ static int if_sdio_probe(struct sdio_func *func,
lbs_remove_card(priv);
free:
destroy_workqueue(card->workqueue);
free_before_queue:
while (card->packets) {
packet = card->packets;
card->packets = card->packets->next;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册