[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <91ea900ce78bb2054d83e0575c16ac70f3f11511.1334654597.git.viresh.kumar@st.com>
Date: Tue, 17 Apr 2012 14:54:00 +0530
From: Viresh Kumar <viresh.kumar@...com>
To: <peppe.cavallaro@...com>
Cc: <spear-devel@...t.st.com>, <viresh.linux@...il.com>,
<netdev@...r.kernel.org>, <davem@...emloft.net>,
Viresh Kumar <viresh.kumar@...com>
Subject: [PATCH] stmmac: fix kernel crash when device probed for SPEAr with DT
plat->dma_cfg is never allocated memory and is tried to be filled when we boot
it for SPEAr SoCs with DT. And so get a kernel crash.
Fix it by allocating memory for dma_cfg.
Signed-off-by: Viresh Kumar <viresh.kumar@...com>
---
.../net/ethernet/stmicro/stmmac/stmmac_platform.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
index 12bd221..f124f60 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
@@ -110,6 +110,14 @@ static int stmmac_pltfr_probe(struct platform_device *pdev)
goto out_unmap;
}
+ plat_dat->dma_cfg = devm_kzalloc(&pdev->dev,
+ sizeof(*plat_dat->dma_cfg), GFP_KERNEL);
+ if (!plat_dat->dma_cfg) {
+ pr_err("%s: ERROR: no memory for dma_cfg", __func__);
+ ret = -ENOMEM;
+ goto out_unmap;
+ }
+
ret = stmmac_probe_config_dt(pdev, plat_dat, &mac);
if (ret) {
pr_err("%s: main dt probe failed", __func__);
--
1.7.9
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists