diff options
author | Ioana Radulescu <ruxandra.radulescu@freescale.com> | 2013-01-31 23:56:08 (GMT) |
---|---|---|
committer | Fleming Andrew-AFLEMING <AFLEMING@freescale.com> | 2013-04-08 23:17:04 (GMT) |
commit | 7bc7300b2efa1c4935acfaf63e229711745db07c (patch) | |
tree | 8652a30361a52c4e7c1a554343c3a750e1cc5384 /drivers | |
parent | 684641aecf8142bf2fba7a69af78cb420053e14f (diff) | |
download | linux-fsl-qoriq-7bc7300b2efa1c4935acfaf63e229711745db07c.tar.xz |
dpaa_eth: Fix error in sysfs
Trying to dump the MAC registers for MACless interfaces resulted
in a segmentation fault. Just print a message for the user instead
of accessing non-existent regs.
Change-Id: I425390fbdf6aa67fa96568a8861576b8706123e7
Signed-off-by: Ioana Radulescu <ruxandra.radulescu@freescale.com>
(cherry picked from commit 86023a9fb24fc56c0e5b9fa76b9ef2ce57f0e013)
Reviewed-on: http://git.am.freescale.net:8181/1048
Reviewed-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
Tested-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ethernet/freescale/dpa/dpaa_eth_sysfs.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/ethernet/freescale/dpa/dpaa_eth_sysfs.c b/drivers/net/ethernet/freescale/dpa/dpaa_eth_sysfs.c index 413f27f..1a75354 100644 --- a/drivers/net/ethernet/freescale/dpa/dpaa_eth_sysfs.c +++ b/drivers/net/ethernet/freescale/dpa/dpaa_eth_sysfs.c @@ -143,7 +143,10 @@ static ssize_t dpaa_eth_show_mac_regs(struct device *dev, struct dpa_priv_s *priv = netdev_priv(to_net_dev(dev)); struct mac_device *mac_dev = priv->mac_dev; - fm_mac_dump_regs(mac_dev); + if (mac_dev) + fm_mac_dump_regs(mac_dev); + else + return sprintf(buf, "no mac registers\n"); return 0; } |