diff options
author | 2019-06-29 15:31:27 -0400 | |
---|---|---|
committer | 2019-07-23 11:44:26 -0400 | |
commit | 322b169476aaeeb96515d69baaee330e47ac10a0 (patch) | |
tree | 31871152308af05784e49d2c74ea8dec950c7f64 | |
parent | media: ti-vpe: fix leaked of_node references (diff) | |
download | linux-322b169476aaeeb96515d69baaee330e47ac10a0.tar.gz linux-322b169476aaeeb96515d69baaee330e47ac10a0.tar.bz2 linux-322b169476aaeeb96515d69baaee330e47ac10a0.zip |
media: staging/media/davinci_vpfe: Add null check post kmalloc
Add NULL check post memory operations
Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
-rw-r--r-- | drivers/staging/media/davinci_vpfe/dm365_ipipe.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/staging/media/davinci_vpfe/dm365_ipipe.c b/drivers/staging/media/davinci_vpfe/dm365_ipipe.c index 52397ad0e3e2..5d8ba357906b 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; |