From: Pete Zaitcev Date: Fri, 29 Jul 2005 19:18:34 +0000 (-0700) Subject: [PATCH] USB: hidinput_hid_event() oops fix X-Git-Tag: v2.6.13-rc5~71 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=a9b2e9170bdf1dd27ca4aa9a63048065d252d116;p=linux-2.6-omap-h63xx.git [PATCH] USB: hidinput_hid_event() oops fix It seems that I see a bug in hidinput_hid_event. The check for NULL can never work, becaue &hidinput->input is nonzero at all times. Cc: Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman Signed-off-by: Linus Torvalds --- diff --git a/drivers/usb/input/hid-input.c b/drivers/usb/input/hid-input.c index e071c8eecce..63a4db721f7 100644 --- a/drivers/usb/input/hid-input.c +++ b/drivers/usb/input/hid-input.c @@ -398,11 +398,12 @@ ignore: void hidinput_hid_event(struct hid_device *hid, struct hid_field *field, struct hid_usage *usage, __s32 value, struct pt_regs *regs) { - struct input_dev *input = &field->hidinput->input; + struct input_dev *input; int *quirks = &hid->quirks; - if (!input) + if (!field->hidinput) return; + input = &field->hidinput->input; input_regs(input, regs);