lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Tue, 29 Apr 2014 20:09:06 +0800 From: Frank Li <Frank.Li@...escale.com> To: <lznuaa@...il.com>, <shawn.guo@...aro.org>, <B38611@...escale.com>, <davem@...emloft.net>, <rmk+kernel@....linux.org.uk> CC: <linux-arm-kernel@...ts.infradead.org>, <netdev@...r.kernel.org>, Frank Li <Frank.Li@...escale.com> Subject: [PATCH net-next 3/7] net:fec: remove checking for NULL phy_dev in fec_enet_close() From: Russell King <rmk+kernel@....linux.org.uk> fep->phy_dev can not be NULL here for two reasons: - fec_enet_open() will have successfully connected the phy, or will have failed. - fec_enet_open() will have called phy_start(fep->phy_dev), which unconditionally dereferences this pointer. If it were to be NULL here, then fec_enet_open() will have already oopsed. Signed-off-by: Russell King <rmk+kernel@....linux.org.uk> Signed-off-by: Frank Li <Frank.Li@...escale.com> --- drivers/net/ethernet/freescale/fec_main.c | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index 875c0ca..b7a5614 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c @@ -1798,10 +1798,8 @@ fec_enet_close(struct net_device *ndev) netif_stop_queue(ndev); fec_stop(ndev); - if (fep->phy_dev) { - phy_stop(fep->phy_dev); - phy_disconnect(fep->phy_dev); - } + phy_stop(fep->phy_dev); + phy_disconnect(fep->phy_dev); fec_enet_free_buffers(ndev); -- 1.7.8 -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@...r.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists