* [PATCH] net: sxgbe: Fix NULL dereferece when using DT
@ 2015-01-15 1:41 Kukjin Kim
2015-01-16 0:14 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Kukjin Kim @ 2015-01-15 1:41 UTC (permalink / raw)
To: netdev; +Cc: Dave Miller, Girish K.S, Byungho An, Kukjin Kim
From: Girish K.S <ks.giri@samsung.com>
When the MAC address is provided in the device tree file, the
condition is true and kernel crashes due to NULL dereference.
Signed-off-by: Girish K.S <ks.giri@samsung.com>
Signed-off-by: Byungho An <bh74.an@samsung.com>
Signed-off-by: Kukjin Kim <kgene@kernel.org>
---
drivers/net/ethernet/samsung/sxgbe/sxgbe_platform.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/samsung/sxgbe/sxgbe_platform.c b/drivers/net/ethernet/samsung/sxgbe/sxgbe_platform.c
index 866560e..b02eed1 100644
--- a/drivers/net/ethernet/samsung/sxgbe/sxgbe_platform.c
+++ b/drivers/net/ethernet/samsung/sxgbe/sxgbe_platform.c
@@ -108,10 +108,6 @@ static int sxgbe_platform_probe(struct platform_device *pdev)
}
}
- /* Get MAC address if available (DT) */
- if (mac)
- ether_addr_copy(priv->dev->dev_addr, mac);
-
priv = sxgbe_drv_probe(&(pdev->dev), plat_dat, addr);
if (!priv) {
pr_err("%s: main driver probe failed\n", __func__);
@@ -125,6 +121,10 @@ static int sxgbe_platform_probe(struct platform_device *pdev)
goto err_drv_remove;
}
+ /* Get MAC address if available (DT) */
+ if (mac)
+ ether_addr_copy(priv->dev->dev_addr, mac);
+
/* Get the TX/RX IRQ numbers */
for (i = 0, chan = 1; i < SXGBE_TX_QUEUES; i++) {
priv->txq[i]->irq_no = irq_of_parse_and_map(node, chan++);
--
2.0.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] net: sxgbe: Fix NULL dereferece when using DT
2015-01-15 1:41 [PATCH] net: sxgbe: Fix NULL dereferece when using DT Kukjin Kim
@ 2015-01-16 0:14 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2015-01-16 0:14 UTC (permalink / raw)
To: kgene; +Cc: netdev, davem, ks.giri, bh74.an
From: Kukjin Kim <kgene@kernel.org>
Date: Thu, 15 Jan 2015 10:41:47 +0900
> From: Girish K.S <ks.giri@samsung.com>
>
> When the MAC address is provided in the device tree file, the
> condition is true and kernel crashes due to NULL dereference.
>
> Signed-off-by: Girish K.S <ks.giri@samsung.com>
> Signed-off-by: Byungho An <bh74.an@samsung.com>
> Signed-off-by: Kukjin Kim <kgene@kernel.org>
Applied.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-01-16 0:14 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-15 1:41 [PATCH] net: sxgbe: Fix NULL dereferece when using DT Kukjin Kim
2015-01-16 0:14 ` David Miller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.