Skip to contentSkip to conversation

media: gspca: null check create_singlethread_workqueue

PATCH New Navid Emamdoost 1 participant 1 message Sep 11, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 media: gspca: null check create_singlethread_workqueue

In sd_start the return value of create_singlethread_workqueue needs null check.

---
 drivers/media/usb/gspca/sq905c.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/media/usb/gspca/sq905c.c +3 -0
index 3d7f6dcdd7a8..6ca947aef298 100644
@@ -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;
Signature · 1 line
2.17.1