diff options
author | Navid Emamdoost <navid.emamdoost@gmail.com> | 2019-09-11 22:26:00 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2019-10-10 12:18:10 +0200 |
commit | 8dbdee8e8acc4f56febb8f5bf226f1ebfdd36219 (patch) | |
tree | 6a2dee9db376fc85482b1c7615cd7b293eabe961 /drivers | |
parent | media: gspca: null check create_singlethread_workqueue (diff) | |
download | linux-8dbdee8e8acc4f56febb8f5bf226f1ebfdd36219.tar.xz linux-8dbdee8e8acc4f56febb8f5bf226f1ebfdd36219.zip |
media: usb: null check create_singlethread_workqueue
In sd_start return value of create_singlethread_workqueue needs null
check.
Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/usb/gspca/sq905.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/media/usb/gspca/sq905.c b/drivers/media/usb/gspca/sq905.c index 863c485f4275..97799cfb832e 100644 --- a/drivers/media/usb/gspca/sq905.c +++ b/drivers/media/usb/gspca/sq905.c @@ -378,6 +378,9 @@ static int sd_start(struct gspca_dev *gspca_dev) } /* Start the workqueue function to do the streaming */ dev->work_thread = create_singlethread_workqueue(MODULE_NAME); + if (!dev->work_thread) + return -ENOMEM; + queue_work(dev->work_thread, &dev->work_struct); return 0; |