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:44:26 +0000 (09:44 +0100)
commit16e187691b476fdd8d2866994e1e01077bed43dc
tree4f8478ad96aeacdda998fde4d14e2ee6cfca61fc
parentc089cbb7c47f485399af4f41b22b2f9c3de18c88
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