Messages in this thread | | | Date | Tue, 19 Jul 2005 00:17:29 -0700 | From | Pete Zaitcev <> | Subject | Re: 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/
| |