From 7b709cf81e39f359ba9a180cfc32370658299f52 Mon Sep 17 00:00:00 2001 From: Madalin Bucur Date: Mon, 17 Jun 2013 16:30:41 +0300 Subject: dpaa_eth: check dpa_mac_probe() result Check for NULL returns from dpa_mac_probe() when probing private and shared interfaces. If a MACless interface is mistakenly identified with the old compatibility string "fsl,dpa-ethernet" instead of the required "fsl,dpa-ethernet-macless" compatibility string the interface is probed as private interface and dpa_mac_probe() fails. Signed-off-by: Madalin Bucur Change-Id: I221d00aafb6ba25f32b7a451610f1e6185bdb7ca Reviewed-on: http://git.am.freescale.net:8181/3091 Reviewed-by: Sovaiala Cristian-Constantin-B39531 Reviewed-by: Radulescu Ruxandra Ioana-B05472 Reviewed-by: Fleming Andrew-AFLEMING Tested-by: Fleming Andrew-AFLEMING diff --git a/drivers/net/ethernet/freescale/dpa/dpaa_eth.c b/drivers/net/ethernet/freescale/dpa/dpaa_eth.c index f121d4f..67d53d0 100644 --- a/drivers/net/ethernet/freescale/dpa/dpaa_eth.c +++ b/drivers/net/ethernet/freescale/dpa/dpaa_eth.c @@ -3070,6 +3070,7 @@ out_error: } static const struct of_device_id dpa_match[]; + static int dpaa_eth_priv_probe(struct platform_device *_of_dev) { @@ -3119,7 +3120,7 @@ dpaa_eth_priv_probe(struct platform_device *_of_dev) priv->msg_enable = netif_msg_init(debug, -1); mac_dev = dpa_mac_probe(_of_dev); - if (IS_ERR(mac_dev)) { + if (IS_ERR(mac_dev) || !mac_dev) { err = PTR_ERR(mac_dev); goto mac_probe_failed; } diff --git a/drivers/net/ethernet/freescale/dpa/dpaa_eth_shared.c b/drivers/net/ethernet/freescale/dpa/dpaa_eth_shared.c index 3bb60e8..2b75b1e 100644 --- a/drivers/net/ethernet/freescale/dpa/dpaa_eth_shared.c +++ b/drivers/net/ethernet/freescale/dpa/dpaa_eth_shared.c @@ -647,7 +647,7 @@ dpaa_eth_shared_probe(struct platform_device *_of_dev) priv->msg_enable = netif_msg_init(debug, -1); mac_dev = dpa_mac_probe(_of_dev); - if (IS_ERR(mac_dev)) { + if (IS_ERR(mac_dev) || !mac_dev) { err = PTR_ERR(mac_dev); goto mac_probe_failed; } -- cgit v0.10.2