media: vivid: fix error handling of kthread_run
authorHans Verkuil <hverkuil-cisco@xs4all.nl>
Mon, 29 Oct 2018 10:15:31 +0000 (06:15 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 26 Jan 2019 08:42:50 +0000 (09:42 +0100)
commit8185cc4ff897d89f2f64ab56d77b7a4c69cbe377
tree623a9a5b124e471b8a3e73f9bdc54356bc4ef5b5
parent505c2ac72a099266f4c530ed987132c98372367f
media: vivid: fix error handling of kthread_run

commit 701f49bc028edb19ffccd101997dd84f0d71e279 upstream.

kthread_run returns an error pointer, but elsewhere in the code
dev->kthread_vid_cap/out is checked against NULL.

If kthread_run returns an error, then set the pointer to NULL.

I chose this method over changing all kthread_vid_cap/out tests
elsewhere since this is more robust.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Reported-by: syzbot+53d5b2df0d9744411e2e@syzkaller.appspotmail.com
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/media/platform/vivid/vivid-kthread-cap.c
drivers/media/platform/vivid/vivid-kthread-out.c