Skip to contentSkip to conversation

Input: fix an OOPS in HID driver

PATCH In review Dmitry Torokhov 3 participants 6 messages Dec 17, 2005 – Dec 22, 2005 USB

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Input: fix an OOPS in HID driver

Subject:

This patch fixes an OOPS in HID driver when connecting simulation devices generating unknown simulation events.

---

 drivers/usb/input/hid-input.c |    1 +
 1 files changed, 1 insertion(+)
drivers/usb/input/hid-input.c +1 -0
Index: work/drivers/usb/input/hid-input.c
===================================================================
@@ -137,6 +137,7 @@ static void hidinput_configure_usage(str
 			switch (usage->hid & 0xffff) {
 				case 0xba: map_abs(ABS_RUDDER); break;
 				case 0xbb: map_abs(ABS_THROTTLE); break;
+				default:   goto unknown;
 			}
 			break;
 
#1 lore raw
Quoted 6 lines · Dmitry Torokhov

Subject:

This patch fixes an OOPS in HID driver when connecting simulation devices generating unknown simulation events.

Yup, needed indeed. I'm not sure if we want an 'unknown': 'ignore' might be safer.

Quoted 19 lines

---

 drivers/usb/input/hid-input.c |    1 +
 1 files changed, 1 insertion(+)

Index: work/drivers/usb/input/hid-input.c
===================================================================

drivers/usb/input/hid-input.c +1 -0
@@ -137,6 +137,7 @@ static void hidinput_configure_usage(str
 			switch (usage->hid & 0xffff) {
 				case 0xba: map_abs(ABS_RUDDER); break;
 				case 0xbb: map_abs(ABS_THROTTLE); break;
+				default:   goto unknown;
 			}
 			break;
 
Signature · 2 lines
Vojtech Pavlik
SuSE Labs, SuSE CR
#3 lore raw

PATCH 1/1 Input: fix an OOPS in HID driver

In reply to Dmitry Torokhov

This patch fixes an OOPS in HID driver when connecting simulation devices generating unknown simulation events.

---

 drivers/usb/input/hid-input.c |    1 +
 1 files changed, 1 insertion(+)
drivers/usb/input/hid-input.c +1 -0
Index: work/drivers/usb/input/hid-input.c
===================================================================
@@ -137,6 +137,7 @@ static void hidinput_configure_usage(str
 			switch (usage->hid & 0xffff) {
 				case 0xba: map_abs(ABS_RUDDER); break;
 				case 0xbb: map_abs(ABS_THROTTLE); break;
+				default:   goto ignore;
 			}
 			break;
 
#2 lore raw
In reply to Vojtech Pavlik
Quoted 10 lines · Vojtech Pavlik
Quoted 6 lines · Dmitry Torokhov

Subject:

This patch fixes an OOPS in HID driver when connecting simulation devices generating unknown simulation events.

Yup, needed indeed. I'm not sure if we want an 'unknown': 'ignore' might be safer.

Well, 'unknown' restores the previous behavior (before simulation codes were added to the driver) so it is pretty safe, however 'ignore' is indeed more correct I think.

I will send an updated patch. Linus, if you already applied the original one just ignore the new one - we can change it post 2.6.15 when we add more simulation codes to HID driver.

Signature · 1 line
Dmitry
#4 lore raw
In reply to Dmitry Torokhov
Quoted 3 lines · Dmitry Torokhov

This patch fixes an OOPS in HID driver when connecting simulation devices generating unknown simulation events.
...

This patch now went into Linus' tree.

It seems this patch should also go into 2.6.14.5? If you agree, please submit it to [email protected] .

TIA
Adrian

Signature · 4 lines
       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed
#5 lore raw
Quoted 11 lines · Adrian Bunk
Quoted 3 lines · Dmitry Torokhov

This patch fixes an OOPS in HID driver when connecting simulation devices generating unknown simulation events.
...

This patch now went into Linus' tree.

It seems this patch should also go into 2.6.14.5? If you agree, please submit it to [email protected] .

Yes, you are right, I will send it there in a minute.

Signature · 1 line
Dmitry