From: Roel Kluin Date: Sat, 19 Sep 2009 00:03:34 +0000 (-0300) Subject: V4L/DVB (13018): kzalloc failure ignored in au8522_probe() X-Git-Tag: v2.6.32-rc1~618^2~11 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=40d2951758d788a0375d27062caf9cc75de735a9;p=profile%2Fivi%2Fkernel-adaptation-intel-automotive.git V4L/DVB (13018): kzalloc failure ignored in au8522_probe() Prevent NULL dereference if kzalloc() fails. Cc: Devin Heitmueller Signed-off-by: Roel Kluin Signed-off-by: Douglas Schilling Landgraf Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/dvb/frontends/au8522_decoder.c b/drivers/media/dvb/frontends/au8522_decoder.c index 9e9a755..74981ee 100644 --- a/drivers/media/dvb/frontends/au8522_decoder.c +++ b/drivers/media/dvb/frontends/au8522_decoder.c @@ -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;