[PATCH] cx88-dvb: Fix Oops in case no i2c bus is available

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi there!

The attached patch will fix an Oops occurring in cx88-dvb when cx88 core does 
not have a valid i2c-bus registered.

The reason for me is different and will be handled (and solved I hope) in 
another thread, but the Oops should not be here and so this is fixed first.

Regards
Matthias
cx88-dvb: Fix Oops in case no i2c bus is available

For me loading i2c_algo_bit with bit_test=1 detects "SDA stuck high" and
aborts registering the cx88 i2c-bus. cx88-dvb however does not check the
registration success and just uses core->i2c_adap to attach dvb frontend
modules leading to an oops in the first i2c_transfer call.
Added a check for i2c registration success before attaching a frontend and
dvb_register will return -EINVAL in error case.

Signed-off-by: Matthias Schwarzott <zzam@xxxxxxxxxx>

Index: v4l-dvb/linux/drivers/media/video/cx88/cx88-dvb.c
===================================================================
--- v4l-dvb.orig/linux/drivers/media/video/cx88/cx88-dvb.c
+++ v4l-dvb/linux/drivers/media/video/cx88/cx88-dvb.c
@@ -533,6 +533,11 @@ static int dvb_register(struct cx8802_de
 	dev->dvb.name = core->name;
 	dev->ts_gen_cntrl = 0x0c;
 
+	if (0 != core->i2c_rc) {
+		printk(KERN_ERR "%s/2: no i2c-bus available, cannot attach dvb drivers\n", core->name);
+		goto frontend_detach;
+	}
+
 	/* init frontend */
 	switch (core->boardnr) {
 	case CX88_BOARD_HAUPPAUGE_DVB_T1:
_______________________________________________
linux-dvb mailing list
linux-dvb@xxxxxxxxxxx
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb

[Index of Archives]     [Linux Media]     [Video 4 Linux]     [Asterisk]     [Samba]     [Xorg]     [Xfree86]     [Linux USB]

  Powered by Linux