Skip to content

Commit

Permalink
V4L/DVB (12421): drivers/media/video/gspca: introduce missing kfree
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Julia Lawall authored and Mauro Carvalho Chehab committed Sep 12, 2009
1 parent 4605812 commit b807d17
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/media/video/gspca/m5602/m5602_s5k83a.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit b807d17

Please sign in to comment.