diff options
author | Roel Kluin <roel.kluin@gmail.com> | 2009-09-18 20:03:34 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-09-18 23:53:35 -0400 |
commit | 40d2951758d788a0375d27062caf9cc75de735a9 (patch) | |
tree | 2ad2264b382d88039354482e65785ed4be667d64 /drivers | |
parent | d8370f7eff14ef646ba4a81eb9642800518a7324 (diff) |
V4L/DVB (13018): kzalloc failure ignored in au8522_probe()
Prevent NULL dereference if kzalloc() fails.
Cc: Devin Heitmueller <dheitmueller@linuxtv.org>
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/dvb/frontends/au8522_decoder.c | 5 |
1 files changed, 5 insertions, 0 deletions
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, | |||
792 | } | 792 | } |
793 | 793 | ||
794 | demod_config = kzalloc(sizeof(struct au8522_config), GFP_KERNEL); | 794 | demod_config = kzalloc(sizeof(struct au8522_config), GFP_KERNEL); |
795 | if (demod_config == NULL) { | ||
796 | if (instance == 1) | ||
797 | kfree(state); | ||
798 | return -ENOMEM; | ||
799 | } | ||
795 | demod_config->demod_address = 0x8e >> 1; | 800 | demod_config->demod_address = 0x8e >> 1; |
796 | 801 | ||
797 | state->config = demod_config; | 802 | state->config = demod_config; |