* [PATCH] media: usb: null check create_singlethread_workqueue
@ 2019-09-11 20:26 Navid Emamdoost
0 siblings, 0 replies; only message in thread
From: Navid Emamdoost @ 2019-09-11 20:26 UTC (permalink / raw)
Cc: emamd001, smccaman, kjlu, Navid Emamdoost, Hans Verkuil,
Mauro Carvalho Chehab, Kate Stewart, Thomas Gleixner,
Greg Kroah-Hartman, linux-media, linux-kernel
In sd_start return value of create_singlethread_workqueue needs null
check.
Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
---
drivers/media/usb/gspca/sq905.c | 3 +++
1 file changed, 3 insertions(+)
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;
--
2.17.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2019-09-11 20:26 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-11 20:26 [PATCH] media: usb: null check create_singlethread_workqueue Navid Emamdoost
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).