Commit 88bdcc5d authored by Jon Burgess's avatar Jon Burgess Committed by Linus Torvalds

[PATCH] dvb: fix NULL pointer dereference when loading the budget-av module

Ralph Metzler wrote:
> AFAIR, there is a bug in tda10021.c in tda10021_readreg() which
> references state->frontend.dvb->num
> This is fatal if the frontend is not at the probed address and thus
> not yet registered (no dvb entry set yet -> NULL pointer ...).

The attached patch should get rid of the oops.
Signed-off-by: default avatarJon Burgess <jburgess@uklinux.net>
Cc: Johannes Stezenbach <js@linuxtv.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 0b8dd177
...@@ -100,8 +100,8 @@ static u8 tda10021_readreg (struct tda10021_state* state, u8 reg) ...@@ -100,8 +100,8 @@ static u8 tda10021_readreg (struct tda10021_state* state, u8 reg)
ret = i2c_transfer (state->i2c, msg, 2); ret = i2c_transfer (state->i2c, msg, 2);
if (ret != 2) if (ret != 2)
printk("DVB: TDA10021(%d): %s: readreg error (ret == %i)\n", printk("DVB: TDA10021: %s: readreg error (ret == %i)\n",
state->frontend.dvb->num, __FUNCTION__, ret); __FUNCTION__, ret);
return b1[0]; return b1[0];
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment