media: staging: greybus: light: fix memory leak in v4l2 register
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. Also use IS_ERR() instead of IS_ERR_OR_NULL() to check return value from v4l2_flash_init() for it never returns NULL. Fixes: 2870b52b ("greybus: lights: add lights implementation") Reported-by: NSakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: NRui Miguel Silva <rmfrfs@gmail.com> Reviewed-by: NViresh Kumar <viresh.kumar@linaro.org> Signed-off-by: NSakari Ailus <sakari.ailus@linux.intel.com> Acked-by: NHans Verkuil <hans.verkuil@cisco.com> Signed-off-by: NMauro Carvalho Chehab <mchehab@s-opensource.com>
Showing
想要评论请 注册 或 登录