smsc9420: prevent BUG() if ethtool is called with interface down
commit0d1bb4e684935fce3fc71bdeb6c1fc89af8e59bb
authorSteve Glendinning <steve.glendinning@smsc.com>
Mon, 30 Nov 2009 07:14:45 +0000 (29 23:14 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 18 Dec 2009 21:43:57 +0000 (18 13:43 -0800)
tree355d2c69f2fea95feddcdb998c5ed238c7f7a5a3
parent3681f3e31bbe46da8c7fd3490f41e0abe93c0084
smsc9420: prevent BUG() if ethtool is called with interface down

[ Upstream commit 6c53b1b15e222244358d3cbbefd2a13920faa352 ]

This patch fixes a null pointer dereference BUG() if ethtool is used on
an smsc9420 interface while it is down, because the phy_dev is only
allocated while the interface is up.

Signed-off-by: Steve Glendinning <steve.glendinning@smsc.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/net/smsc9420.c