Commit a38aaaa4 authored by Wei Yongjun's avatar Wei Yongjun Committed by Mauro Carvalho Chehab

[media] vivid: fix error return code in vivid_create_instance()

Fix to return error code -ENOMEM from the memory or workqueue alloc
error handling case instead of 0, as done elsewhere in this function.
Signed-off-by: default avatarWei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent e1618a57
...@@ -839,6 +839,7 @@ static int vivid_create_instance(struct platform_device *pdev, int inst) ...@@ -839,6 +839,7 @@ static int vivid_create_instance(struct platform_device *pdev, int inst)
dev->radio_tx_caps = V4L2_CAP_RDS_OUTPUT | V4L2_CAP_MODULATOR | dev->radio_tx_caps = V4L2_CAP_RDS_OUTPUT | V4L2_CAP_MODULATOR |
V4L2_CAP_READWRITE; V4L2_CAP_READWRITE;
ret = -ENOMEM;
/* initialize the test pattern generator */ /* initialize the test pattern generator */
tpg_init(&dev->tpg, 640, 360); tpg_init(&dev->tpg, 640, 360);
if (tpg_alloc(&dev->tpg, MAX_ZOOM * MAX_WIDTH)) if (tpg_alloc(&dev->tpg, MAX_ZOOM * MAX_WIDTH))
...@@ -1033,8 +1034,10 @@ static int vivid_create_instance(struct platform_device *pdev, int inst) ...@@ -1033,8 +1034,10 @@ static int vivid_create_instance(struct platform_device *pdev, int inst)
*/ */
dev->cec_workqueue = dev->cec_workqueue =
alloc_ordered_workqueue("vivid-%03d-cec", WQ_MEM_RECLAIM, inst); alloc_ordered_workqueue("vivid-%03d-cec", WQ_MEM_RECLAIM, inst);
if (!dev->cec_workqueue) if (!dev->cec_workqueue) {
ret = -ENOMEM;
goto unreg_dev; goto unreg_dev;
}
/* start creating the vb2 queues */ /* start creating the vb2 queues */
if (dev->has_vid_cap) { if (dev->has_vid_cap) {
......
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