]> git.karo-electronics.de Git - linux-beck.git/commitdiff
[media] coda: fix the error path in coda_probe()
authorFabio Estevam <fabio.estevam@nxp.com>
Tue, 4 Oct 2016 15:41:37 +0000 (12:41 -0300)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Mon, 24 Oct 2016 20:34:45 +0000 (18:34 -0200)
In the case of coda_firmware_request() failure, we should release the
prevously acquired resources.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/platform/coda/coda-common.c

index c39718a63e5edbf8f6d12bf639279a3dab946724..9e6bdafa16f583fc657940824cf9d1236bd9a249 100644 (file)
@@ -2295,8 +2295,13 @@ static int coda_probe(struct platform_device *pdev)
        pm_runtime_set_active(&pdev->dev);
        pm_runtime_enable(&pdev->dev);
 
-       return coda_firmware_request(dev);
+       ret = coda_firmware_request(dev);
+       if (ret)
+               goto err_alloc_workqueue;
+       return 0;
 
+err_alloc_workqueue:
+       destroy_workqueue(dev->workqueue);
 err_v4l2_register:
        v4l2_device_unregister(&dev->v4l2_dev);
        return ret;