Preserve the error code stored in "dev->kthread_cec" before setting it
to NULL.
Fixes: 439e520995ab ("media: vivid: add signal-free time for cec message xfer")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
dev->kthread_cec = kthread_run(vivid_cec_bus_thread, dev,
"vivid_cec-%s", dev->v4l2_dev.name);
if (IS_ERR(dev->kthread_cec)) {
+ ret = PTR_ERR(dev->kthread_cec);
dev->kthread_cec = NULL;
v4l2_err(&dev->v4l2_dev, "kernel_thread() failed\n");
- ret = PTR_ERR(dev->kthread_cec);
goto unreg_dev;
}
}