diff options
author | Julia Lawall <julia@diku.dk> | 2009-08-04 21:00:24 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-09-12 11:18:46 -0400 |
commit | b807d17555dcc4ea28abadd4d647ba0c4d822cdb (patch) | |
tree | c50db85dfa93b96d909c716f0ad3899fc62f4446 | |
parent | 46058128ff57db466ec132cb7de76cf9ecbd3dd3 (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>
-rw-r--r-- | drivers/media/video/gspca/m5602/m5602_s5k83a.c | 4 |
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 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: | |||
178 | 178 | ||
179 | sens_priv->settings = | 179 | sens_priv->settings = |
180 | kmalloc(sizeof(s32)*ARRAY_SIZE(s5k83a_ctrls), GFP_KERNEL); | 180 | kmalloc(sizeof(s32)*ARRAY_SIZE(s5k83a_ctrls), GFP_KERNEL); |
181 | if (!sens_priv->settings) | 181 | if (!sens_priv->settings) { |
182 | kfree(sens_priv); | ||
182 | return -ENOMEM; | 183 | return -ENOMEM; |
184 | } | ||
183 | 185 | ||
184 | sd->gspca_dev.cam.cam_mode = s5k83a_modes; | 186 | sd->gspca_dev.cam.cam_mode = s5k83a_modes; |
185 | sd->gspca_dev.cam.nmodes = ARRAY_SIZE(s5k83a_modes); | 187 | sd->gspca_dev.cam.nmodes = ARRAY_SIZE(s5k83a_modes); |