aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video
diff options
context:
space:
mode:
authorMurali Karicheri <m-karicheri2@ti.com>2010-03-01 17:54:02 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-05-06 18:19:02 -0400
commitab51bec1f852f6b858a26e745b32a79cd1a67eec (patch)
tree9715f24a8928ea93519a58bf1b1bea3f2ecdca7c /drivers/media/video
parentb704e82a54591d69816b45f4324caf143f1a6fc8 (diff)
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>
Diffstat (limited to 'drivers/media/video')
-rw-r--r--drivers/media/video/davinci/vpfe_capture.c5
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 7cf042f9b377..55128644b5d7 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)
1830 if (NULL == ccdc_cfg) { 1830 if (NULL == ccdc_cfg) {
1831 v4l2_err(pdev->dev.driver, 1831 v4l2_err(pdev->dev.driver,
1832 "Memory allocation failed for ccdc_cfg\n"); 1832 "Memory allocation failed for ccdc_cfg\n");
1833 goto probe_free_dev_mem; 1833 goto probe_free_lock;
1834 } 1834 }
1835 1835
1836 strncpy(ccdc_cfg->name, vpfe_cfg->ccdc, 32); 1836 strncpy(ccdc_cfg->name, vpfe_cfg->ccdc, 32);
@@ -1982,8 +1982,9 @@ probe_out_video_release:
1982probe_out_release_irq: 1982probe_out_release_irq:
1983 free_irq(vpfe_dev->ccdc_irq0, vpfe_dev); 1983 free_irq(vpfe_dev->ccdc_irq0, vpfe_dev);
1984probe_free_ccdc_cfg_mem: 1984probe_free_ccdc_cfg_mem:
1985 mutex_unlock(&ccdc_lock);
1986 kfree(ccdc_cfg); 1985 kfree(ccdc_cfg);
1986probe_free_lock:
1987 mutex_unlock(&ccdc_lock);
1987probe_free_dev_mem: 1988probe_free_dev_mem:
1988 kfree(vpfe_dev); 1989 kfree(vpfe_dev);
1989 return ret; 1990 return ret;