media: staging: davinci: fix for memory leak
Subsystems (2)
PATCH 1/1 media: staging: davinci: fix for memory leak
In ipipe_g_config the allocated memory for params needs to be released if either module_if->get or copy_to_user fails.
Signed-off-by Navid Emamdoost <[email protected]>
--- drivers/staging/media/davinci_vpfe/dm365_ipipe.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/staging/media/davinci_vpfe/dm365_ipipe.c +4 -1
@@ -1316,10 +1316,13 @@ static int ipipe_g_config(struct v4l2_subdev *sd, struct vpfe_ipipe_config *cfg)if (to && from && size) { rval = module_if->get (ipipe, from); -if (rval) +if (rval) { +kfree (params); goto error; + }if (copy_to_user ((void __user *)to, from, size)) { rval = -EFAULT ; +kfree (params);break ; } }
Signature · 1 line
2.17.1