From: Julia Lawall Date: Wed, 5 Aug 2009 01:00:24 +0000 (-0300) Subject: V4L/DVB (12421): drivers/media/video/gspca: introduce missing kfree X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b807d17555dcc4ea28abadd4d647ba0c4d822cdb;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git V4L/DVB (12421): drivers/media/video/gspca: introduce missing kfree Error handling code following a kmalloc should free the allocated data. Signed-off-by: Julia Lawall Acked-by: Erik Andrén Signed-off-by: Douglas Schilling Landgraf Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/video/gspca/m5602/m5602_s5k83a.c b/drivers/media/video/gspca/m5602/m5602_s5k83a.c index 7127321ace8c..6b89f33a4ce0 100644 --- a/drivers/media/video/gspca/m5602/m5602_s5k83a.c +++ b/drivers/media/video/gspca/m5602/m5602_s5k83a.c @@ -178,8 +178,10 @@ sensor_found: sens_priv->settings = kmalloc(sizeof(s32)*ARRAY_SIZE(s5k83a_ctrls), GFP_KERNEL); - if (!sens_priv->settings) + if (!sens_priv->settings) { + kfree(sens_priv); return -ENOMEM; + } sd->gspca_dev.cam.cam_mode = s5k83a_modes; sd->gspca_dev.cam.nmodes = ARRAY_SIZE(s5k83a_modes);