提交 b807d175 编写于 作者: J Julia Lawall 提交者: 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: NJulia Lawall <julia@diku.dk>
Acked-by: NErik Andrén <erik.andren@gmail.com>
Signed-off-by: NDouglas Schilling Landgraf <dougsland@redhat.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册