summaryrefslogtreecommitdiffstats
path: root/drivers/media/usb
diff options
context:
space:
mode:
authorNavid Emamdoost <navid.emamdoost@gmail.com>2019-09-11 17:26:00 -0300
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2019-10-10 07:18:10 -0300
commit8dbdee8e8acc4f56febb8f5bf226f1ebfdd36219 (patch)
tree6a2dee9db376fc85482b1c7615cd7b293eabe961 /drivers/media/usb
parent68085f314d6429ddfb09756623e2bfeec2966909 (diff)
downloadlinux-8dbdee8e8acc4f56febb8f5bf226f1ebfdd36219.tar.bz2
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/media/usb')
-rw-r--r--drivers/media/usb/gspca/sq905.c3
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;