summaryrefslogtreecommitdiffstats
path: root/drivers/media/usb/gspca
diff options
context:
space:
mode:
authorNavid Emamdoost <navid.emamdoost@gmail.com>2019-09-11 22:20:12 +0200
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2019-10-10 12:17:54 +0200
commit68085f314d6429ddfb09756623e2bfeec2966909 (patch)
treeec6da9202da066a64331a1c84489f18fd19b612c /drivers/media/usb/gspca
parentmedia: cx88: Add support for NotOnlyTV LV3H card (diff)
downloadlinux-68085f314d6429ddfb09756623e2bfeec2966909.tar.xz
linux-68085f314d6429ddfb09756623e2bfeec2966909.zip
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/media/usb/gspca')
-rw-r--r--drivers/media/usb/gspca/sq905c.c3
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;