]> git.baikalelectronics.ru Git - kernel.git/commit
iio: adc: xilinx: fix potential use-after-free on probe
authorSven Van Asbroeck <thesven73@gmail.com>
Sun, 10 Mar 2019 18:58:25 +0000 (14:58 -0400)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 16 Mar 2019 15:48:51 +0000 (15:48 +0000)
commit25833d7fed7388196e5671ac0cd712483e74d791
tree0c5e475e1ebba1a363f44f4fc8a347c47c0c6cba
parentb0dc82a68a738a6cc13bf96345efe7ac7b924787
iio: adc: xilinx: fix potential use-after-free on probe

If probe errors out after request_irq(), its error path
does not explicitly cancel the delayed work, which may
have been scheduled by the interrupt handler.

This means the delayed work may still be running when
the core frees the private structure (struct xadc).
This is a potential use-after-free.

Fix by inserting cancel_delayed_work_sync() in the probe
error path.

Signed-off-by: Sven Van Asbroeck <TheSven73@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/xilinx-xadc-core.c