diff options
author | Remi Pommarel <repk@triplefau.lt> | 2019-01-11 00:01:35 +0100 |
---|---|---|
committer | Ulf Hansson <ulf.hansson@linaro.org> | 2019-01-14 12:03:04 +0100 |
commit | bb364890323cca6e43f13e86d190ebf34a7d8cea (patch) | |
tree | 73b48a1dd6299be611cd61f3bf2ff8667a6dcc1b /scripts/gcc-plugins/gcc-generate-simple_ipa-pass.h | |
parent | 287b1da6a458a30da2e5be745498d31092ebb001 (diff) |
mmc: meson-gx: Free irq in release() callback
Because the irq was requested through device managed resources API
(devm_request_threaded_irq()) it was freed after meson_mmc_remove()
completion, thus after mmc_free_host() has reclaimed meson_host memory.
As this irq is IRQF_SHARED, while using CONFIG_DEBUG_SHIRQ, its handler
get called by free_irq(). So meson_mmc_irq() was called after the
meson_host memory reclamation and was using invalid memory.
We ended up with the following scenario:
device_release_driver()
meson_mmc_remove()
mmc_free_host() /* Freeing host memory */
...
devres_release_all()
devm_irq_release()
__free_irq()
meson_mmc_irq() /* Uses freed memory */
To avoid this, the irq is released in meson_mmc_remove() and in
mseon_mmc_probe() error path before mmc_free_host() gets called.
Reported-by: Elie Roudninski <xademax@gmail.com>
Signed-off-by: Remi Pommarel <repk@triplefau.lt>
Cc: stable@vger.kernel.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'scripts/gcc-plugins/gcc-generate-simple_ipa-pass.h')
0 files changed, 0 insertions, 0 deletions