From: Fabio Estevam Date: Tue, 4 Oct 2016 15:41:37 +0000 (-0300) Subject: [media] coda: fix the error path in coda_probe() X-Git-Tag: v5.15~10718^2~1300 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c762ff1f7e3b09293c22ce62135ef550c1b3327c;p=platform%2Fkernel%2Flinux-starfive.git [media] coda: fix the error path in coda_probe() In the case of coda_firmware_request() failure, we should release the prevously acquired resources. Signed-off-by: Fabio Estevam Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/platform/coda/coda-common.c b/drivers/media/platform/coda/coda-common.c index c39718a..9e6bdaf 100644 --- a/drivers/media/platform/coda/coda-common.c +++ b/drivers/media/platform/coda/coda-common.c @@ -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;