From 1b3c6a946d980cf70b0679679e3b56d7ce563db4 Mon Sep 17 00:00:00 2001 From: Douglas Schilling Landgraf Date: Fri, 18 Sep 2009 20:26:53 -0300 Subject: kmalloc failure ignored in lgdt3304_attach() and s921_attach() From: Roel Kluin Prevent NULL dereference if kmalloc() fails. Priority: normal Signed-off-by: Roel Kluin CC: Markus Rechberger Signed-off-by: Douglas Schilling Landgraf --- linux/drivers/media/dvb/frontends/lgdt3304.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'linux/drivers/media/dvb/frontends/lgdt3304.c') diff --git a/linux/drivers/media/dvb/frontends/lgdt3304.c b/linux/drivers/media/dvb/frontends/lgdt3304.c index 3a4a18970..c71ccf029 100644 --- a/linux/drivers/media/dvb/frontends/lgdt3304.c +++ b/linux/drivers/media/dvb/frontends/lgdt3304.c @@ -383,6 +383,8 @@ struct dvb_frontend* lgdt3304_attach(const struct lgdt3304_config *config, struct lgdt3304_state *state; state = kzalloc(sizeof(struct lgdt3304_state), GFP_KERNEL); + if (state == NULL) + return NULL; state->addr = config->i2c_address; state->i2c = i2c; -- cgit v1.2.3