summaryrefslogtreecommitdiffstats
path: root/drivers/uwb
diff options
context:
space:
mode:
authorSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>2012-09-20 01:15:00 +0100
committerJonathan Cameron <jic23@kernel.org>2012-09-22 10:07:34 +0100
commitf07b60b7c34b771431f1d00e783f29a3667ff5ee (patch)
treebafe8ebf6796ead4414ac0f8530c5c4e43d3e46f /drivers/uwb
parent24db0d75d3666b2aa5950a8bec0c1898929f2945 (diff)
downloadop-kernel-dev-f07b60b7c34b771431f1d00e783f29a3667ff5ee.zip
op-kernel-dev-f07b60b7c34b771431f1d00e783f29a3667ff5ee.tar.gz
iio: hid-sensors: Prevent crash during hot-unplug
When hid sensor hub is unplugged, there is a crash in iio_device_unregister_trigger_consumer. In a typical IIO driver when remove is called, it will unregister and free trigger and then it will call iio_device_free. The function iio_trigger_free() will free the allocated memory for trigger. If this trigger was assigned to iio_dev->trig, then it should be set to NULL. Othewise when iio_device_free() is called later, it finally calls iio_device_unregsister_trigger(), which checks for if (indio_dev->trig) iio_trigger_put(indio_dev->trig); If indio_dev->trig is not set to NULL, it calls iio_trigger_put on a bad pointer causing crash. This scenerio can happen in any driver, which is storing trigger pointer in iio_dev structure and following current procedure during remove. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/uwb')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud