[PATCH] fix NULL pointer dereference in NOVA T USB2 Remote Control

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

 



This patch fixes the NULL pointer exception while using the Remote
Control for a NOVA T USB2.

Basically this line was missing (for the properties of the device
"dvb_usb_device_properties")

      .size_of_priv     = sizeof(struct dibusb_state),

I'm not sure the fix is 100% correct since the same line is present
for the properties of the adapter (dvb_usb_device_adapter_properties),
both at around line 154 of
/linux/drivers/media/dvb/dvb-usb/nova-t-usb2.c.

The question is: the "struct dibusb_state" should be allocated for

1) the device
2) the adapter
3) both

?

Should the patch remove the allocation of "priv" for the adapter?

Any suggestions?

Thanks
diff -r 7efa405e2d66 linux/drivers/media/dvb/dvb-usb/nova-t-usb2.c
--- a/linux/drivers/media/dvb/dvb-usb/nova-t-usb2.c	Fri Oct 06 17:12:00 2006 -0300
+++ b/linux/drivers/media/dvb/dvb-usb/nova-t-usb2.c	Sun Oct 08 12:07:41 2006 +0100
@@ -90,9 +90,9 @@ static int nova_t_rc_query(struct dvb_us
 			deb_rc("raw key code 0x%02x, 0x%02x, 0x%02x to c: %02x d: %02x toggle: %d\n",key[1],key[2],key[3],custom,data,toggle);
 
 			for (i = 0; i < ARRAY_SIZE(haupp_rc_keys); i++) {
-				deb_rc("c: %x, d: %x\n",haupp_rc_keys[i].data,haupp_rc_keys[i].custom);
 				if (haupp_rc_keys[i].data == data &&
 					haupp_rc_keys[i].custom == custom) {
+				        deb_rc("c: %x, d: %x\n",haupp_rc_keys[i].data,haupp_rc_keys[i].custom);
 					*event = haupp_rc_keys[i].event;
 					*state = REMOTE_KEY_PRESSED;
 					if (st->old_toggle == toggle) {
@@ -187,6 +187,8 @@ static struct dvb_usb_device_properties 
 
 	.power_ctrl       = dibusb2_0_power_ctrl,
 	.read_mac_address = nova_t_read_mac_address,
+	
+	.size_of_priv     = sizeof(struct dibusb_state),
 
 	.rc_interval      = 100,
 	.rc_key_map       = haupp_rc_keys,
_______________________________________________
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