diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2016-11-21 11:59:20 -0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2016-11-22 08:13:24 -0200 |
commit | 1827bdc7b141859a1eb9d2d45bb923ea7252774a (patch) | |
tree | 87e8b2aec48cd9fa50c23fd99a4fb7660c1ad533 /drivers/media | |
parent | ed1f47cc69c3f230d394e001012336877d730ea2 (diff) | |
download | op-kernel-dev-1827bdc7b141859a1eb9d2d45bb923ea7252774a.zip op-kernel-dev-1827bdc7b141859a1eb9d2d45bb923ea7252774a.tar.gz |
[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: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/platform/davinci/vpfe_capture.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/media/platform/davinci/vpfe_capture.c b/drivers/media/platform/davinci/vpfe_capture.c index 6c41782..bc2c62b 100644 --- a/drivers/media/platform/davinci/vpfe_capture.c +++ b/drivers/media/platform/davinci/vpfe_capture.c @@ -1847,8 +1847,10 @@ static int vpfe_probe(struct platform_device *pdev) /* Allocate memory for ccdc configuration */ ccdc_cfg = kmalloc(sizeof(*ccdc_cfg), GFP_KERNEL); - if (!ccdc_cfg) + if (!ccdc_cfg) { + ret = -ENOMEM; goto probe_free_dev_mem; + } mutex_lock(&ccdc_lock); |