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>
This commit is contained in:
Hariprasad Kelam 2019-06-29 15:31:27 -04:00 committed by Mauro Carvalho Chehab
parent 094efbe748
commit 322b169476

View File

@ -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;