summaryrefslogtreecommitdiffstats
path: root/drivers/media/video/gspca
diff options
context:
space:
mode:
authorJulia Lawall <julia@diku.dk>2009-08-04 22:00:24 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-09-12 12:18:46 -0300
commitb807d17555dcc4ea28abadd4d647ba0c4d822cdb (patch)
treec50db85dfa93b96d909c716f0ad3899fc62f4446 /drivers/media/video/gspca
parent46058128ff57db466ec132cb7de76cf9ecbd3dd3 (diff)
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>
Diffstat (limited to 'drivers/media/video/gspca')
-rw-r--r--drivers/media/video/gspca/m5602/m5602_s5k83a.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/media/video/gspca/m5602/m5602_s5k83a.c b/drivers/media/video/gspca/m5602/m5602_s5k83a.c
index 7127321ace8..6b89f33a4ce 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);