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: firefly_0821_release~12898^2~11 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=40d2951758d788a0375d27062caf9cc75de735a9;p=firefly-linux-kernel-4.4.55.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 9e9a75576a1d..74981ee923c8 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;