[media] coda: Unregister v4l2 upon alloc_workqueue() error
authorFabio Estevam <fabio.estevam@freescale.com>
Sat, 4 Oct 2014 19:40:51 +0000 (16:40 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Mon, 3 Nov 2014 19:55:22 +0000 (17:55 -0200)
If alloc_workqueue() fails, we should go to the 'err_v4l2_register' label, which
will unregister the v4l2 device.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Acked-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/platform/coda/coda-common.c

index 1871f0502f4260fd3c6b784bc4f496a5d45a307a..42b46301eff230657080bf2a18965ebca67232b8 100644 (file)
@@ -2152,7 +2152,8 @@ static int coda_probe(struct platform_device *pdev)
        dev->workqueue = alloc_workqueue("coda", WQ_UNBOUND | WQ_MEM_RECLAIM, 1);
        if (!dev->workqueue) {
                dev_err(&pdev->dev, "unable to alloc workqueue\n");
-               return -ENOMEM;
+               ret = -ENOMEM;
+               goto err_v4l2_register;
        }
 
        platform_set_drvdata(pdev, dev);