diff options
author | Navid Emamdoost <navid.emamdoost@gmail.com> | 2019-09-11 17:20:12 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2019-10-10 07:17:54 -0300 |
commit | 68085f314d6429ddfb09756623e2bfeec2966909 (patch) | |
tree | ec6da9202da066a64331a1c84489f18fd19b612c /drivers | |
parent | e6f45ea2e7211850d2301a726d195a61fde0ccda (diff) |
media: gspca: null check create_singlethread_workqueue
In sd_start the 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/sq905c.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/media/usb/gspca/sq905c.c b/drivers/media/usb/gspca/sq905c.c index 3d7f6dcdd7a8..6ca947aef298 100644 --- a/drivers/media/usb/gspca/sq905c.c +++ b/drivers/media/usb/gspca/sq905c.c @@ -276,6 +276,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; |