Commit 21001fdb authored by Dan Carpenter's avatar Dan Carpenter Committed by Mauro Carvalho Chehab

media: vivid: fix an error code in vivid_create_instance()

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: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent d47fed7a
...@@ -1934,9 +1934,9 @@ static int vivid_create_instance(struct platform_device *pdev, int inst) ...@@ -1934,9 +1934,9 @@ static int vivid_create_instance(struct platform_device *pdev, int inst)
dev->kthread_cec = kthread_run(vivid_cec_bus_thread, dev, dev->kthread_cec = kthread_run(vivid_cec_bus_thread, dev,
"vivid_cec-%s", dev->v4l2_dev.name); "vivid_cec-%s", dev->v4l2_dev.name);
if (IS_ERR(dev->kthread_cec)) { if (IS_ERR(dev->kthread_cec)) {
ret = PTR_ERR(dev->kthread_cec);
dev->kthread_cec = NULL; dev->kthread_cec = NULL;
v4l2_err(&dev->v4l2_dev, "kernel_thread() failed\n"); v4l2_err(&dev->v4l2_dev, "kernel_thread() failed\n");
ret = PTR_ERR(dev->kthread_cec);
goto unreg_dev; goto unreg_dev;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment