diff options
author | Sven Van Asbroeck <thesven73@gmail.com> | 2019-03-10 19:58:26 +0100 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2019-03-16 16:49:56 +0100 |
commit | 2e4b88f73966adead360e47621df0183586fac32 (patch) | |
tree | f669a42923202901eee174bb40c1ba839f63c1b0 /drivers/iio/adc | |
parent | iio: adc: xilinx: fix potential use-after-free on probe (diff) | |
download | linux-2e4b88f73966adead360e47621df0183586fac32.tar.xz linux-2e4b88f73966adead360e47621df0183586fac32.zip |
iio: adc: xilinx: prevent touching unclocked h/w on remove
In remove, the clock is disabled before canceling the
delayed work. This means that the delayed work may be
touching unclocked hardware.
Fix by disabling the clock after the delayed work is
fully canceled. This is consistent with the probe error
path order.
Signed-off-by: Sven Van Asbroeck <TheSven73@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/adc')
-rw-r--r-- | drivers/iio/adc/xilinx-xadc-core.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iio/adc/xilinx-xadc-core.c b/drivers/iio/adc/xilinx-xadc-core.c index 5a1b63f9d041..6401ca7a9a20 100644 --- a/drivers/iio/adc/xilinx-xadc-core.c +++ b/drivers/iio/adc/xilinx-xadc-core.c @@ -1322,8 +1322,8 @@ static int xadc_remove(struct platform_device *pdev) iio_triggered_buffer_cleanup(indio_dev); } free_irq(xadc->irq, indio_dev); - clk_disable_unprepare(xadc->clk); cancel_delayed_work_sync(&xadc->zynq_unmask_work); + clk_disable_unprepare(xadc->clk); kfree(xadc->data); kfree(indio_dev->channels); |