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 <julia@diku.dk>
Acked-by: Erik Andrén <erik.andren@gmail.com>
Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
Julia Lawall 2009-08-04 22:00:24 -03:00 committed by Mauro Carvalho Chehab
parent 46058128ff
commit b807d17555

View File

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