From 1827bdc7b141859a1eb9d2d45bb923ea7252774a Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Mon, 21 Nov 2016 11:59:20 -0200 Subject: [PATCH] [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 --- drivers/media/platform/davinci/vpfe_capture.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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); -- 2.20.1