Skip to contentSkip to conversation

V4L/DVB: dib0700: Prevent NULL pointer dereference during probe

PATCH In review Jean Delvare 2 participants 3 messages Sep 26, 2010 – Oct 8, 2010 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 V4L/DVB: dib0700: Prevent NULL pointer dereference during probe

Commit 8dc09004978538d211ccc36b5046919489e30a55 assumes that dev->rc_input_dev is always set. It is, however, NULL if dvb-usb was loaded with option disable_rc_polling=1.

Cc Mauro Carvalho Chehab <[email protected]>
---
 drivers/media/dvb/dvb-usb/dib0700_core.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/media/dvb/dvb-usb/dib0700_core.c +2 -1
@@ -674,7 +674,8 @@ static int dib0700_probe(struct usb_inte
 				dev->props.rc.core.bulk_mode = false;
 
 			/* Need a higher delay, to avoid wrong repeat */
-			dev->rc_input_dev->rep[REP_DELAY] = 500;
+			if (dev->rc_input_dev)
+				dev->rc_input_dev->rep[REP_DELAY] = 500;
 
 			dib0700_rc_setup(dev);
 
Signature · 1 line
Jean Delvare
#1 lore raw
Quoted 13 lines · Jean Delvare

Commit 8dc09004978538d211ccc36b5046919489e30a55 assumes that dev->rc_input_dev is always set. It is, however, NULL if dvb-usb was loaded with option disable_rc_polling=1.

Cc Mauro Carvalho Chehab <[email protected]>
---
 drivers/media/dvb/dvb-usb/dib0700_core.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

drivers/media/dvb/dvb-usb/dib0700_core.c static int dib0700_probe(struct usb_inte · line 681

Quoted 9 lines
drivers/media/dvb/dvb-usb/dib0700_core.c +2 -1
@@ -674,7 +674,8 @@ static int dib0700_probe(struct usb_inte
 				dev->props.rc.core.bulk_mode = false;
 
 			/* Need a higher delay, to avoid wrong repeat */
-			dev->rc_input_dev->rep[REP_DELAY] = 500;
+			if (dev->rc_input_dev)
+				dev->rc_input_dev->rep[REP_DELAY] = 500;
 
 			dib0700_rc_setup(dev);
 

The already applied commit 04cab131ce2a267b6777a98d68fbc0cae44d4ba8 (V4L/DVB: rc-core: increase repeat time) solves the problem in a different way, so you can ignore my patch above, it is no longer needed.

Signature · 1 line
Jean Delvare
#2 lore raw

Em 08-10-2010 09:32, Jean Delvare escreveu:

Quoted 21 lines · Jean Delvare
Quoted 20 lines

Commit 8dc09004978538d211ccc36b5046919489e30a55 assumes that dev->rc_input_dev is always set. It is, however, NULL if dvb-usb was loaded with option disable_rc_polling=1.

Cc Mauro Carvalho Chehab <[email protected]>
---
 drivers/media/dvb/dvb-usb/dib0700_core.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/media/dvb/dvb-usb/dib0700_core.c +2 -1
@@ -674,7 +674,8 @@ static int dib0700_probe(struct usb_inte
 				dev->props.rc.core.bulk_mode = false;
 
 			/* Need a higher delay, to avoid wrong repeat */
-			dev->rc_input_dev->rep[REP_DELAY] = 500;
+			if (dev->rc_input_dev)
+				dev->rc_input_dev->rep[REP_DELAY] = 500;
 
Quoted 7 lines

drivers/media/dvb/dvb-usb/dib0700_core.c static int dib0700_probe(struct usb_inte · line 681

Quoted 2 lines
drivers/media/dvb/dvb-usb/dib0700_core.c +0 -0
 			dib0700_rc_setup(dev);
 

The already applied commit 04cab131ce2a267b6777a98d68fbc0cae44d4ba8 (V4L/DVB: rc-core: increase repeat time) solves the problem in a different way, so you can ignore my patch above, it is no longer needed.

OK.

Yeah, we needed to move this to IR core, as other drivers were suffering the same issue, due to RC core timeouts.

Cheers,
Mauro