提交 40d29517 编写于 作者: R Roel Kluin 提交者: Mauro Carvalho Chehab

V4L/DVB (13018): kzalloc failure ignored in au8522_probe()

Prevent NULL dereference if kzalloc() fails.

Cc: Devin Heitmueller <dheitmueller@linuxtv.org>
Signed-off-by: NRoel Kluin <roel.kluin@gmail.com>
Signed-off-by: NDouglas Schilling Landgraf <dougsland@redhat.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 d8370f7e
......@@ -792,6 +792,11 @@ static int au8522_probe(struct i2c_client *client,
}
demod_config = kzalloc(sizeof(struct au8522_config), GFP_KERNEL);
if (demod_config == NULL) {
if (instance == 1)
kfree(state);
return -ENOMEM;
}
demod_config->demod_address = 0x8e >> 1;
state->config = demod_config;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册