diff options
author | Murali Karicheri <m-karicheri2@ti.com> | 2010-03-01 22:54:02 (GMT) |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-05-06 22:19:02 (GMT) |
commit | ab51bec1f852f6b858a26e745b32a79cd1a67eec (patch) | |
tree | 9715f24a8928ea93519a58bf1b1bea3f2ecdca7c | |
parent | b704e82a54591d69816b45f4324caf143f1a6fc8 (diff) | |
download | linux-fsl-qoriq-ab51bec1f852f6b858a26e745b32a79cd1a67eec.tar.xz |
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: Murali Karicheri <m-karicheri2@ti.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | drivers/media/video/davinci/vpfe_capture.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/media/video/davinci/vpfe_capture.c b/drivers/media/video/davinci/vpfe_capture.c index 7cf042f..5512864 100644 --- a/drivers/media/video/davinci/vpfe_capture.c +++ b/drivers/media/video/davinci/vpfe_capture.c @@ -1830,7 +1830,7 @@ static __init int vpfe_probe(struct platform_device *pdev) if (NULL == ccdc_cfg) { v4l2_err(pdev->dev.driver, "Memory allocation failed for ccdc_cfg\n"); - goto probe_free_dev_mem; + goto probe_free_lock; } strncpy(ccdc_cfg->name, vpfe_cfg->ccdc, 32); @@ -1982,8 +1982,9 @@ probe_out_video_release: probe_out_release_irq: free_irq(vpfe_dev->ccdc_irq0, vpfe_dev); probe_free_ccdc_cfg_mem: - mutex_unlock(&ccdc_lock); kfree(ccdc_cfg); +probe_free_lock: + mutex_unlock(&ccdc_lock); probe_free_dev_mem: kfree(vpfe_dev); return ret; |