Skip to content

Commit

Permalink
V4L/DVB (13016): kmalloc failure ignored in lgdt3304_attach() and s92…
Browse files Browse the repository at this point in the history
…1_attach()

Prevent NULL dereference if kmalloc() fails.

Cc: Markus Rechberger <mrechberger@sundtek.de>
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>
  • Loading branch information
Roel Kluin authored and Mauro Carvalho Chehab committed Sep 19, 2009
1 parent 1601fb1 commit 8d04df4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/media/dvb/frontends/lgdt3304.c
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,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;

Expand Down
2 changes: 2 additions & 0 deletions drivers/media/dvb/frontends/s921_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,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;
Expand Down

0 comments on commit 8d04df4

Please sign in to comment.