From: Pete Zaitcev <zaitcev@redhat.com>
To: Jesper Juhl <jesper.juhl@gmail.com>
Cc: vojtech@suse.cz, linux-kernel@vger.kernel.org, zaitcev@redhat.com
Subject: Re: Fw: Oops in hidinput_hid_event
Date: Tue, 19 Jul 2005 00:17:29 -0700 [thread overview]
Message-ID: <20050719001729.36d35238.zaitcev@redhat.com> (raw)
In-Reply-To: <9a874849050718183175bc08d4@mail.gmail.com>
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
next prev parent reply other threads:[~2005-07-19 7:17 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-07-18 21:16 Fw: Oops in hidinput_hid_event Pete Zaitcev
2005-07-19 1:31 ` Jesper Juhl
2005-07-19 1:34 ` Jesper Juhl
2005-07-19 7:17 ` Pete Zaitcev [this message]
2005-07-19 13:30 ` Vojtech Pavlik
2005-07-26 14:11 ` Sergey Vlasov
2005-07-26 3:52 ` Andrew Morton
2005-07-26 4:13 ` Pete Zaitcev
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20050719001729.36d35238.zaitcev@redhat.com \
--to=zaitcev@redhat.com \
--cc=jesper.juhl@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=vojtech@suse.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox