tree 048526305102fb981c5a2940bab99e872d6f78a1
parent 498f78e6fcf558d0dec31f5648f43426ae16433f
author Pete Zaitcev <[EMAIL PROTECTED]> Sat, 30 Jul 2005 02:18:34 -0700
committer Linus Torvalds <[EMAIL PROTECTED]> Sat, 30 Jul 2005 03:12:54 -0700

[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: <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>

 drivers/usb/input/hid-input.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/input/hid-input.c b/drivers/usb/input/hid-input.c
--- 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);
 
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to