提交 2b080c5d 编写于 作者: D Dan Carpenter 提交者: Mauro Carvalho Chehab

V4L/DVB: davinci: don't return under lock on error path

If the kmalloc() failed for "ccdc_cfg = kmalloc(...);" then we would exit
with the lock held.  I moved the mutex_lock() below the allocation
because it isn't protecting anything in that block and allocations are
allocations are sometimes slow.
Signed-off-by: NDan Carpenter <error27@gmail.com>
Acked-by: NVaibhav Hiremath <hvaibhav@ti.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 3f113e36
......@@ -1861,7 +1861,6 @@ static __init int vpfe_probe(struct platform_device *pdev)
goto probe_free_dev_mem;
}
mutex_lock(&ccdc_lock);
/* Allocate memory for ccdc configuration */
ccdc_cfg = kmalloc(sizeof(struct ccdc_config), GFP_KERNEL);
if (NULL == ccdc_cfg) {
......@@ -1870,6 +1869,8 @@ static __init int vpfe_probe(struct platform_device *pdev)
goto probe_free_lock;
}
mutex_lock(&ccdc_lock);
strncpy(ccdc_cfg->name, vpfe_cfg->ccdc, 32);
/* Get VINT0 irq resource */
res1 = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册