]> git.baikalelectronics.ru Git - kernel.git/commit
net: mdio: octeon: Fix some double free issues
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Thu, 13 May 2021 07:24:55 +0000 (09:24 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 13 May 2021 22:43:52 +0000 (15:43 -0700)
commitb3667ddf6e5abb1c27089f85b5611f4c3bc80cc2
tree8e6b4f3938f4e378120a4d4e7bd793a57ee6bea4
parentddc45d647e2b6be3e3add69bd27c281793867a0e
net: mdio: octeon: Fix some double free issues

'bus->mii_bus' has been allocated with 'devm_mdiobus_alloc_size()' in the
probe function. So it must not be freed explicitly or there will be a
double free.

Remove the incorrect 'mdiobus_free' in the error handling path of the
probe function and in remove function.

Suggested-By: Andrew Lunn <andrew@lunn.ch>
Fixes: 35810e638db9 ("phy: mdio-octeon: Use devm_mdiobus_alloc_size()")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Russell King <rmk+kernel@armlinux.org.uk>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/mdio/mdio-octeon.c