mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-03 07:38:10 +00:00
parisc: led: Fix potential null-ptr-deref in start_task()
commit41f563ab3c
upstream. start_task() calls create_singlethread_workqueue() and not checked the ret value, which may return NULL. And a null-ptr-deref may happen: start_task() create_singlethread_workqueue() # failed, led_wq is NULL queue_delayed_work() queue_delayed_work_on() __queue_delayed_work() # warning here, but continue __queue_work() # access wq->flags, null-ptr-deref Check the ret value and return -ENOMEM if it is NULL. Fixes:3499495205
("[PARISC] Use work queue in LED/LCD driver instead of tasklet.") Signed-off-by: Shang XiaoJing <shangxiaojing@huawei.com> Signed-off-by: Helge Deller <deller@gmx.de> Cc: <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
0226b3ddad
commit
fc307b2905
1 changed files with 3 additions and 0 deletions
|
@ -141,6 +141,9 @@ static int start_task(void)
|
|||
|
||||
/* Create the work queue and queue the LED task */
|
||||
led_wq = create_singlethread_workqueue("led_wq");
|
||||
if (!led_wq)
|
||||
return -ENOMEM;
|
||||
|
||||
queue_delayed_work(led_wq, &led_task, 0);
|
||||
|
||||
return 0;
|
||||
|
|
Loading…
Reference in a new issue