summaryrefslogtreecommitdiff
path: root/drivers/media/platform/vivid
diff options
context:
space:
mode:
authorWei Yongjun <weiyongjun1@huawei.com>2016-09-15 06:36:09 +0300
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2016-09-19 20:18:42 +0300
commita38aaaa43d1acd037afd1bd84ebf9d855afdf714 (patch)
tree2b6f95b009739accafba87f066e3056d881134a3 /drivers/media/platform/vivid
parente1618a57b9951a3182b52c4605948c8bb9bb0ea4 (diff)
downloadlinux-a38aaaa43d1acd037afd1bd84ebf9d855afdf714.tar.xz
[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: Wei Yongjun <weiyongjun1@huawei.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/platform/vivid')
-rw-r--r--drivers/media/platform/vivid/vivid-core.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/media/platform/vivid/vivid-core.c b/drivers/media/platform/vivid/vivid-core.c
index 741460ab68ab..5464fefbaab9 100644
--- a/drivers/media/platform/vivid/vivid-core.c
+++ b/drivers/media/platform/vivid/vivid-core.c
@@ -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 |
V4L2_CAP_READWRITE;
+ ret = -ENOMEM;
/* initialize the test pattern generator */
tpg_init(&dev->tpg, 640, 360);
if (tpg_alloc(&dev->tpg, MAX_ZOOM * MAX_WIDTH))
@@ -1033,8 +1034,10 @@ static int vivid_create_instance(struct platform_device *pdev, int inst)
*/
dev->cec_workqueue =
alloc_ordered_workqueue("vivid-%03d-cec", WQ_MEM_RECLAIM, inst);
- if (!dev->cec_workqueue)
+ if (!dev->cec_workqueue) {
+ ret = -ENOMEM;
goto unreg_dev;
+ }
/* start creating the vb2 queues */
if (dev->has_vid_cap) {