In the Linux kernel, the following vulnerability has been resolved: iio: adc: at91-sama5d2adc: Fix potential use-after-free in sama5d2adc driver at91adcinterrupt can call at91adctouchdatahandler function to start the work by schedulework(&st->touchst.workq). If we remove the module which will call at91adcremove to make cleanup, it will free indiodev through iiodeviceunregister but quite a bit later. While the work mentioned above will be used. The sequence of operations that may lead to a UAF bug is as follows: CPU0 CPU1 | at91adcworkqhandler at91adcremove | iiodeviceunregister(indiodev) | //free indiodev a bit later | | iiopushtobuffers(indiodev) | //use indiodev Fix it by ensuring that the work is canceled before proceeding with the cleanup in at91adc_remove.