[greybus-dev] [PATCH] staging: greybus: light: fix memory leak in v4l2 register

Viresh Kumar viresh.kumar at linaro.org
Thu Aug 3 03:48:44 UTC 2017


On 02-08-17, 17:52, Rui Miguel Silva wrote:
> We are allocating memory for the v4l2 flash configuration structure and
> leak it in the normal path. Just use the stack for this as we do not
> use it outside of this function.
> 
> Fixes: 2870b52bae4c ("greybus: lights: add lights implementation")
> Reported-by: Sakari Ailus <sakari.ailus at linux.intel.com>
> Signed-off-by: Rui Miguel Silva <rmfrfs at gmail.com>
> ---
>  drivers/staging/greybus/light.c | 29 +++++++++--------------------
>  1 file changed, 9 insertions(+), 20 deletions(-)

It isn't a really big structure, so allocating on stack should be
fine.

Reviewed-by: Viresh Kumar <viresh.kumar at linaro.org>

-- 
viresh


More information about the devel mailing list