Skip to content

Commit

Permalink
[PATCH] USB: hidinput_hid_event() oops fix
Browse files Browse the repository at this point in the history
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: <vojtech@suse.cz>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Pete Zaitcev authored and Linus Torvalds committed Jul 29, 2005
1 parent 498f78e commit a9b2e91
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/usb/input/hid-input.c
Original file line number Diff line number Diff line change
Expand Up @@ -398,11 +398,12 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel

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);

Expand Down

0 comments on commit a9b2e91

Please sign in to comment.