From: okash.khawaja@gmail.com (Okash Khawaja)
To: kernelnewbies@lists.kernelnewbies.org
Subject: unregister_input_polled_device() leads to null pointer deref
Date: Mon, 28 Mar 2016 14:32:45 +0100 [thread overview]
Message-ID: <20160328133245.GA6753@bytefire-computer> (raw)
Hi,
I'm writing a i2c device driver. In probe(), among other things I call:
polled_input = input_allocate_polled_device();
input_register_polled_device(polled_input);
Then inside remove(), I extract the instance of input_polled_dev and
call
input_unregister_polled_device(polled_input);
This results in kernel error:
"Unable to handle kernel NULL pointer dereference at virtual address
00000474".
It turns out that the input_dev pointer inside input_polled_dev is null
which leads to this error. But why is input_dev pointer null? It is not
null inside probe() function and I don't release it anywhere.
This is code: http://pastebin.com/JJdepyEG and here is link to the output,
along with my log statements: http://pastebin.com/badwSvyy.
Thanks,
Okash
next reply other threads:[~2016-03-28 13:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-28 13:32 Okash Khawaja [this message]
2016-03-28 13:55 ` unregister_input_polled_device() leads to null pointer deref Carlo Caione
2016-03-28 14:13 ` Okash Khawaja
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=20160328133245.GA6753@bytefire-computer \
--to=okash.khawaja@gmail.com \
--cc=kernelnewbies@lists.kernelnewbies.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.