Commit b807d175 authored by Julia Lawall's avatar Julia Lawall Committed by Mauro Carvalho Chehab

V4L/DVB (12421): drivers/media/video/gspca: introduce missing kfree

Error handling code following a kmalloc should free the allocated data.
Signed-off-by: default avatarJulia Lawall <julia@diku.dk>
Acked-by: default avatarErik Andrén <erik.andren@gmail.com>
Signed-off-by: default avatarDouglas Schilling Landgraf <dougsland@redhat.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 46058128
......@@ -178,8 +178,10 @@ int s5k83a_probe(struct sd *sd)
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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment