Commit ab51bec1 authored by Murali Karicheri's avatar Murali Karicheri Committed by Mauro Carvalho Chehab

V4L/DVB: V4L: vpfe_capture - free ccdc_lock when memory allocation fails

This patch fixes a bug in vpfe_probe() that doesn't call mutex_unlock() if memory
allocation for ccdc_cfg fails. See also the smatch warning report from Dan
Carpenter that shows this as an issue.
Signed-off-by: default avatarMurali Karicheri <m-karicheri2@ti.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent b704e82a
...@@ -1830,7 +1830,7 @@ static __init int vpfe_probe(struct platform_device *pdev) ...@@ -1830,7 +1830,7 @@ static __init int vpfe_probe(struct platform_device *pdev)
if (NULL == ccdc_cfg) { if (NULL == ccdc_cfg) {
v4l2_err(pdev->dev.driver, v4l2_err(pdev->dev.driver,
"Memory allocation failed for ccdc_cfg\n"); "Memory allocation failed for ccdc_cfg\n");
goto probe_free_dev_mem; goto probe_free_lock;
} }
strncpy(ccdc_cfg->name, vpfe_cfg->ccdc, 32); strncpy(ccdc_cfg->name, vpfe_cfg->ccdc, 32);
...@@ -1982,8 +1982,9 @@ probe_out_video_release: ...@@ -1982,8 +1982,9 @@ probe_out_video_release:
probe_out_release_irq: probe_out_release_irq:
free_irq(vpfe_dev->ccdc_irq0, vpfe_dev); free_irq(vpfe_dev->ccdc_irq0, vpfe_dev);
probe_free_ccdc_cfg_mem: probe_free_ccdc_cfg_mem:
mutex_unlock(&ccdc_lock);
kfree(ccdc_cfg); kfree(ccdc_cfg);
probe_free_lock:
mutex_unlock(&ccdc_lock);
probe_free_dev_mem: probe_free_dev_mem:
kfree(vpfe_dev); kfree(vpfe_dev);
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment