提交 42109a8d 编写于 作者: E Eugen Hristev 提交者: Xie XiuQi

media: atmel: atmel-isc: fix INIT_WORK misplacement

commit 79199002db5c571e335131856b3ff057ffd9f3c0 upstream.

In case the completion function failes, unbind will be called
which will call cancel_work for awb_work.
This will trigger a WARN message from the workqueue.
To avoid this, move the INIT_WORK call at the start of the completion
function. This way the work is always initialized, which corresponds
to the 'always canceled' unbind code.

Fixes: 93d4a26c ("[media] atmel-isc: add the isc pipeline function")
Signed-off-by: NEugen Hristev <eugen.hristev@microchip.com>
Signed-off-by: NHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: NLee Jones <lee.jones@linaro.org>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 77dac897
...@@ -1895,6 +1895,8 @@ static int isc_async_complete(struct v4l2_async_notifier *notifier) ...@@ -1895,6 +1895,8 @@ static int isc_async_complete(struct v4l2_async_notifier *notifier)
struct vb2_queue *q = &isc->vb2_vidq; struct vb2_queue *q = &isc->vb2_vidq;
int ret; int ret;
INIT_WORK(&isc->awb_work, isc_awb_work);
ret = v4l2_device_register_subdev_nodes(&isc->v4l2_dev); ret = v4l2_device_register_subdev_nodes(&isc->v4l2_dev);
if (ret < 0) { if (ret < 0) {
v4l2_err(&isc->v4l2_dev, "Failed to register subdev nodes\n"); v4l2_err(&isc->v4l2_dev, "Failed to register subdev nodes\n");
...@@ -1948,8 +1950,6 @@ static int isc_async_complete(struct v4l2_async_notifier *notifier) ...@@ -1948,8 +1950,6 @@ static int isc_async_complete(struct v4l2_async_notifier *notifier)
return ret; return ret;
} }
INIT_WORK(&isc->awb_work, isc_awb_work);
/* Register video device */ /* Register video device */
strlcpy(vdev->name, ATMEL_ISC_NAME, sizeof(vdev->name)); strlcpy(vdev->name, ATMEL_ISC_NAME, sizeof(vdev->name));
vdev->release = video_device_release_empty; vdev->release = video_device_release_empty;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册