diff options
author | Roel Kluin <roel.kluin@gmail.com> | 2009-08-29 14:31:49 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-02-26 13:10:50 -0500 |
commit | fb3ab105a5ef43b03d2788e9b124c7c69112682f (patch) | |
tree | 7f2abc1370c9d899ac93d1f0f04377049e369f0c /drivers/media/dvb/frontends | |
parent | 6adb21c8719feef3b1629f5a9b5535e914f897ed (diff) |
V4L/DVB: stv0900: dereference of state->internal in fe_stv0900_error 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>
Diffstat (limited to 'drivers/media/dvb/frontends')
-rw-r--r-- | drivers/media/dvb/frontends/stv0900_core.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/media/dvb/frontends/stv0900_core.c b/drivers/media/dvb/frontends/stv0900_core.c index 74791d550dc7..e5791b2b913b 100644 --- a/drivers/media/dvb/frontends/stv0900_core.c +++ b/drivers/media/dvb/frontends/stv0900_core.c | |||
@@ -1384,7 +1384,14 @@ static enum fe_stv0900_error stv0900_init_internal(struct dvb_frontend *fe, | |||
1384 | } else { | 1384 | } else { |
1385 | state->internal = kmalloc(sizeof(struct stv0900_internal), | 1385 | state->internal = kmalloc(sizeof(struct stv0900_internal), |
1386 | GFP_KERNEL); | 1386 | GFP_KERNEL); |
1387 | if (state->internal == NULL) | ||
1388 | return STV0900_INVALID_HANDLE; | ||
1387 | temp_int = append_internal(state->internal); | 1389 | temp_int = append_internal(state->internal); |
1390 | if (temp_int == NULL) { | ||
1391 | kfree(state->internal); | ||
1392 | state->internal = NULL; | ||
1393 | return STV0900_INVALID_HANDLE; | ||
1394 | } | ||
1388 | state->internal->dmds_used = 1; | 1395 | state->internal->dmds_used = 1; |
1389 | state->internal->i2c_adap = state->i2c_adap; | 1396 | state->internal->i2c_adap = state->i2c_adap; |
1390 | state->internal->i2c_addr = state->config->demod_address; | 1397 | state->internal->i2c_addr = state->config->demod_address; |