linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] staging/media/davinci_vpfe: Add null check post kmalloc
@ 2019-06-29 19:31 Hariprasad Kelam
  0 siblings, 0 replies; only message in thread
From: Hariprasad Kelam @ 2019-06-29 19:31 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Greg Kroah-Hartman, Hans Verkuil,
	Irenge Jules Bashizi, Ioannis Valasakis, Michelle Darcy,
	Mamta Shukla, Christophe JAILLET, Colin Ian King,
	Hariprasad Kelam, Madhumitha Prabakaran, linux-media, devel,
	linux-kernel

Add NULL check post memory operations

Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.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


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2019-06-29 19:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-29 19:31 [PATCH] staging/media/davinci_vpfe: Add null check post kmalloc Hariprasad Kelam

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).