lkml.org 
[lkml]   [2005]   [Jul]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Fw: Oops in hidinput_hid_event
On Tue, 19 Jul 2005 03:31:12 +0200, Jesper Juhl <jesper.juhl@gmail.com> wrote:

> > 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)
>
> How about
> if (!field || !field->hdinput)
> instead?
>
> > return;
> > + input = &field->hidinput->input;

It would be more reliable, certainly. However, this is likely not what
Vojtech has intended. I do not understand how this code functions,
and I would be ashamed just adding NULL checks all over the place.
Also, the original oops happens after a certain field was accessed,
not at an argument. It's not quite clear to me what happened, because
of optimizations, but I suspect this may be it.

-- Pete
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-07-19 09:21    [W:0.059 / U:1.504 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site