diff options
author | Marian Rotariu <marian.rotariu@freescale.com> | 2014-02-11 13:15:20 (GMT) |
---|---|---|
committer | Madalin-Cristian Bucur <madalin.bucur@freescale.com> | 2014-02-18 16:23:41 (GMT) |
commit | 3b97a8acdd7d70ba9a99e9c7370742d05c861781 (patch) | |
tree | 3c2d01227da5c9856235f96c5f447bde2b6cac09 /drivers/net/ethernet/freescale/dpa | |
parent | 0e70bd6439bd64e4f857778d568ef9773c88f1af (diff) | |
download | linux-fsl-qoriq-3b97a8acdd7d70ba9a99e9c7370742d05c861781.tar.xz |
dpaa_eth: Fix invalid reference for macless driver
A common macless driver does not have MAC device control capabilities.
Therefore its proxy_dev reference will be NULL. All common operation used also
by the macless driver with MAC device control capabilities that use this
reference should be properly guarded.
Signed-off-by: Marian Rotariu <marian.rotariu@freescale.com>
Change-Id: I1cbb51a64d9251d1dbf7597c7c95e0227007beb4
Reviewed-on: http://git.am.freescale.net:8181/8724
Reviewed-by: Madalin-Cristian Bucur <madalin.bucur@freescale.com>
Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com>
Reviewed-by: Cristian-Constantin Sovaiala <Cristian.Sovaiala@freescale.com>
Reviewed-by: Jose Rivera <German.Rivera@freescale.com>
(cherry picked from commit 210462a5048889279c035392e62ff400fe9d6c6c)
Reviewed-on: http://git.am.freescale.net:8181/8907
Tested-by: Madalin-Cristian Bucur <madalin.bucur@freescale.com>
Diffstat (limited to 'drivers/net/ethernet/freescale/dpa')
-rw-r--r-- | drivers/net/ethernet/freescale/dpa/dpaa_eth_macless.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/drivers/net/ethernet/freescale/dpa/dpaa_eth_macless.c b/drivers/net/ethernet/freescale/dpa/dpaa_eth_macless.c index b7cfad3..738cb14 100644 --- a/drivers/net/ethernet/freescale/dpa/dpaa_eth_macless.c +++ b/drivers/net/ethernet/freescale/dpa/dpaa_eth_macless.c @@ -358,9 +358,23 @@ static int dpaa_eth_macless_probe(struct platform_device *_of_dev) sprintf(priv->if_type, "macless%d", macless_idx++); priv->msg_enable = netif_msg_init(debug, -1); - /* control over proxy's mac device */ - priv->peer = (void *)proxy_dev; - priv->mac_dev = proxy_dev->mac_dev; + + priv->peer = NULL; + if (proxy_dev) { + /* This is a temporary solution for the need of + * having main driver upstreamability: adjust_link + * is a general function that should work for both + * private driver and macless driver with MAC device + * control capabilities even if the last will not be + * upstreamable. + * TODO: find a convenient solution (wrapper over + * main priv structure, etc.) + */ + priv->mac_dev = proxy_dev->mac_dev; + + /* control over proxy's mac device */ + priv->peer = (void *)proxy_dev; + } INIT_LIST_HEAD(&priv->dpa_fq_list); |