From: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
To: Jonathan Cameron <jic23@kernel.org>, linux-iio@vger.kernel.org
Subject: panic in iio_trigger_notify_done
Date: Fri, 04 Jul 2014 11:59:48 -0700 [thread overview]
Message-ID: <53B6F9A4.2080302@linux.intel.com> (raw)
Hi Jonathan,
I got reports of some rare to reproduce random crash in inv_mpu6050 driver.
Always crash points to iio_trigger_notify_done.
Usually, when user space disconnects the trigger by writing a dummy name,
(following example generic_buffer.c)
this indio_dev->trig can be set to NULL. But there can be race between
kernel and user space, so still the iio_trigger_notify_done can be
called, which will try to dereference on NULL pointer.
Recently you commented on my patch that setting
"indio_dev->trig
This is dangerous. Doing it like this will, IIRC leave the wrong
reference counts for the trigger. If you really, really want to do
this then call iio_get_trigger on the trigger as well to increment
the use count. Preferred option is to leave the binding to userspace
after the driver is probed.
"
I have seen several drivers in upstream kernel is doing this assignment,
I have patches to correct all of them assuming they will used on
x86 platform.
Is it OK to submit patches for all even, if we don't have evidence of
problem?
Thanks,
Srinivas
next reply other threads:[~2014-07-04 18:59 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-04 18:59 Srinivas Pandruvada [this message]
2014-07-04 21:09 ` panic in iio_trigger_notify_done Jonathan Cameron
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=53B6F9A4.2080302@linux.intel.com \
--to=srinivas.pandruvada@linux.intel.com \
--cc=jic23@kernel.org \
--cc=linux-iio@vger.kernel.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.