Skip to content

Commit

Permalink
V4L/DVB: stv0900: dereference of state->internal in fe_stv0900_error …
Browse files Browse the repository at this point in the history
…stv0900_init_internal()

state->internal allocation may fail as well as the allocation of
stv0900_first_inode or new_node->next_inode in append_internal().

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Roel Kluin authored and Mauro Carvalho Chehab committed Feb 26, 2010
1 parent 6adb21c commit fb3ab10
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions drivers/media/dvb/frontends/stv0900_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1384,7 +1384,14 @@ static enum fe_stv0900_error stv0900_init_internal(struct dvb_frontend *fe,
} else {
state->internal = kmalloc(sizeof(struct stv0900_internal),
GFP_KERNEL);
if (state->internal == NULL)
return STV0900_INVALID_HANDLE;
temp_int = append_internal(state->internal);
if (temp_int == NULL) {
kfree(state->internal);
state->internal = NULL;
return STV0900_INVALID_HANDLE;
}
state->internal->dmds_used = 1;
state->internal->i2c_adap = state->i2c_adap;
state->internal->i2c_addr = state->config->demod_address;
Expand Down

0 comments on commit fb3ab10

Please sign in to comment.