From: Hans Verkuil Date: Mon, 21 Nov 2016 13:59:20 +0000 (-0200) Subject: [media] vpfe_capture: fix compiler warning X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1827bdc7b141859a1eb9d2d45bb923ea7252774a;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git [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 Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/platform/davinci/vpfe_capture.c b/drivers/media/platform/davinci/vpfe_capture.c index 6c41782b3ba0..bc2c62b95493 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);