Skip to content

Commit

Permalink
media: gspca: null check create_singlethread_workqueue
Browse files Browse the repository at this point in the history
In sd_start the return value of create_singlethread_workqueue needs
null check.

Signed-off-by: Navid Emamdoost <[email protected]>
Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
  • Loading branch information
Navidem authored and mchehab committed Oct 10, 2019
1 parent e6f45ea commit 68085f3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/media/usb/gspca/sq905c.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 68085f3

Please sign in to comment.