From: Fabio Estevam <fabio.este...@freescale.com>

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.este...@freescale.com>
---
 drivers/media/platform/coda/coda-common.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/media/platform/coda/coda-common.c 
b/drivers/media/platform/coda/coda-common.c
index 7cd82e8..951f1d4 100644
--- a/drivers/media/platform/coda/coda-common.c
+++ b/drivers/media/platform/coda/coda-common.c
@@ -1971,7 +1971,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);
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to