[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20190629193127.GA18943@hari-Inspiron-1545>
Date: Sun, 30 Jun 2019 01:01:27 +0530
From: Hariprasad Kelam <hariprasad.kelam@...il.com>
To: Mauro Carvalho Chehab <mchehab@...nel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Hans Verkuil <hverkuil-cisco@...all.nl>,
Irenge Jules Bashizi <jbi.octave@...il.com>,
Ioannis Valasakis <code@...ofe.uk>,
Michelle Darcy <mdarcy137@...il.com>,
Mamta Shukla <mamtashukla555@...il.com>,
Christophe JAILLET <christophe.jaillet@...adoo.fr>,
Colin Ian King <colin.king@...onical.com>,
Hariprasad Kelam <hariprasad.kelam@...il.com>,
Madhumitha Prabakaran <madhumithabiw@...il.com>,
linux-media@...r.kernel.org, devel@...verdev.osuosl.org,
linux-kernel@...r.kernel.org
Subject: [PATCH] staging/media/davinci_vpfe: Add null check post kmalloc
Add NULL check post memory operations
Signed-off-by: Hariprasad Kelam <hariprasad.kelam@...il.com>
---
drivers/staging/media/davinci_vpfe/dm365_ipipe.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/staging/media/davinci_vpfe/dm365_ipipe.c b/drivers/staging/media/davinci_vpfe/dm365_ipipe.c
index 52397ad..5d8ba35 100644
--- a/drivers/staging/media/davinci_vpfe/dm365_ipipe.c
+++ b/drivers/staging/media/davinci_vpfe/dm365_ipipe.c
@@ -1311,6 +1311,11 @@ static int ipipe_g_config(struct v4l2_subdev *sd, struct vpfe_ipipe_config *cfg)
to = *(void **)((void *)cfg + module_if->config_offset);
params = kmalloc(sizeof(*params), GFP_KERNEL);
+ if (!params) {
+ rval = -ENOMEM;
+ goto error;
+ }
+
from = (void *)params + module_if->param_offset;
size = module_if->param_size;
--
2.7.4
Powered by blists - more mailing lists