From: Dan Carpenter Date: Tue, 2 Mar 2010 22:46:10 +0000 (+0000) Subject: cpmac: use after free X-Git-Tag: Ubuntu-5.10.0-12.13~29085^2~85 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=48a29516e8b0b8cd59f5afec90a14f49dd9cf967;p=mirror_ubuntu-hirsute-kernel.git cpmac: use after free The original code dereferenced "cpmac_mii" after calling "mdiobus_free(cpmac_mii);" Signed-off-by: Dan Carpenter Reviewed-by: Jiri Pirko Signed-off-by: David S. Miller --- diff --git a/drivers/net/cpmac.c b/drivers/net/cpmac.c index b85c81f60d10..9d489421535e 100644 --- a/drivers/net/cpmac.c +++ b/drivers/net/cpmac.c @@ -1290,8 +1290,8 @@ void __devexit cpmac_exit(void) { platform_driver_unregister(&cpmac_driver); mdiobus_unregister(cpmac_mii); - mdiobus_free(cpmac_mii); iounmap(cpmac_mii->priv); + mdiobus_free(cpmac_mii); } module_init(cpmac_init);