summaryrefslogtreecommitdiff
path: root/linux/drivers/media
diff options
context:
space:
mode:
authorDouglas Schilling Landgraf <dougsland@redhat.com>2009-09-18 20:26:53 -0300
committerDouglas Schilling Landgraf <dougsland@redhat.com>2009-09-18 20:26:53 -0300
commit1b3c6a946d980cf70b0679679e3b56d7ce563db4 (patch)
tree3e90fe5a66057a9257815b4e24acb4ee789ae03e /linux/drivers/media
parent49cbf78b4386e4d4519cb6cd76af2b4c2bb8e395 (diff)
downloadmediapointer-dvb-s2-1b3c6a946d980cf70b0679679e3b56d7ce563db4.tar.gz
mediapointer-dvb-s2-1b3c6a946d980cf70b0679679e3b56d7ce563db4.tar.bz2
kmalloc failure ignored in lgdt3304_attach() and s921_attach()
From: Roel Kluin <roel.kluin@gmail.com> Prevent NULL dereference if kmalloc() fails. Priority: normal Signed-off-by: Roel Kluin <roel.kluin@gmail.com> CC: Markus Rechberger <mrechberger@sundtek.de> Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
Diffstat (limited to 'linux/drivers/media')
-rw-r--r--linux/drivers/media/dvb/frontends/lgdt3304.c2
-rw-r--r--linux/drivers/media/dvb/frontends/s921_module.c2
2 files changed, 4 insertions, 0 deletions
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;
diff --git a/linux/drivers/media/dvb/frontends/s921_module.c b/linux/drivers/media/dvb/frontends/s921_module.c
index 4a673c184..55f8f8d8d 100644
--- a/linux/drivers/media/dvb/frontends/s921_module.c
+++ b/linux/drivers/media/dvb/frontends/s921_module.c
@@ -233,6 +233,8 @@ struct dvb_frontend* s921_attach(const struct s921_config *config,
struct s921_state *state;
state = kzalloc(sizeof(struct s921_state), GFP_KERNEL);
+ if (state == NULL)
+ return NULL;
state->addr = config->i2c_address;
state->i2c = i2c;