提交 1827bdc7 编写于 作者: H Hans Verkuil 提交者: Mauro Carvalho Chehab

[media] vpfe_capture: fix compiler warning

davinci/vpfe_capture.c: In function 'vpfe_probe':
davinci/vpfe_capture.c:1992:9: warning: 'ret' may be used uninitialized
in this function [-Wmaybe-uninitialized]
   return ret;
          ^~~

This is indeed correct, so if the kmalloc fails set ret to -ENOMEM.
Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab@s-opensource.com>
上级 ed1f47cc
...@@ -1847,8 +1847,10 @@ static int vpfe_probe(struct platform_device *pdev) ...@@ -1847,8 +1847,10 @@ static int vpfe_probe(struct platform_device *pdev)
/* Allocate memory for ccdc configuration */ /* Allocate memory for ccdc configuration */
ccdc_cfg = kmalloc(sizeof(*ccdc_cfg), GFP_KERNEL); ccdc_cfg = kmalloc(sizeof(*ccdc_cfg), GFP_KERNEL);
if (!ccdc_cfg) if (!ccdc_cfg) {
ret = -ENOMEM;
goto probe_free_dev_mem; goto probe_free_dev_mem;
}
mutex_lock(&ccdc_lock); mutex_lock(&ccdc_lock);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册