]> err.no Git - linux-2.6/commitdiff
[PATCH] dvb: fix NULL pointer dereference when loading the budget-av module
authorJon Burgess <jburgess@uklinux.net>
Wed, 28 Sep 2005 04:45:26 +0000 (21:45 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Wed, 28 Sep 2005 14:46:40 +0000 (07:46 -0700)
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: Jon Burgess <jburgess@uklinux.net>
Cc: Johannes Stezenbach <js@linuxtv.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/media/dvb/frontends/tda10021.c

index 87d5f4d8790ffdfb47d6d78704e48fd699508005..eaf130e666d8b232b311103a95ebdcb1cfd9db27 100644 (file)
@@ -100,8 +100,8 @@ static u8 tda10021_readreg (struct tda10021_state* state, u8 reg)
 
        ret = i2c_transfer (state->i2c, msg, 2);
        if (ret != 2)
-               printk("DVB: TDA10021(%d): %s: readreg error (ret == %i)\n",
-                               state->frontend.dvb->num, __FUNCTION__, ret);
+               printk("DVB: TDA10021: %s: readreg error (ret == %i)\n",
+                               __FUNCTION__, ret);
        return b1[0];
 }