From: Corentin LABBE Date: Fri, 26 Aug 2016 11:11:33 +0000 (+0200) Subject: hwrng: amd - release_region must be called after hwrng_unregister X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=fdec60d683568c8e79457c106fa6642ca7ae95f3;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git hwrng: amd - release_region must be called after hwrng_unregister The driver release the memory region before being sure that nobody use it. This patch made hwrng_unregister ran before any release was done. Signed-off-by: LABBE Corentin Signed-off-by: Herbert Xu --- diff --git a/drivers/char/hw_random/amd-rng.c b/drivers/char/hw_random/amd-rng.c index de82fe3643a5..383e1974234d 100644 --- a/drivers/char/hw_random/amd-rng.c +++ b/drivers/char/hw_random/amd-rng.c @@ -151,8 +151,9 @@ static void __exit mod_exit(void) { u32 pmbase = (unsigned long)amd_rng.priv; - release_region(pmbase + 0xF0, 8); hwrng_unregister(&amd_rng); + + release_region(pmbase + 0xF0, 8); } module_init(mod_init);