mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] Fix a data abort with fec_imx
@ 2010-01-11 14:32 Eric Benard
  2010-01-11 17:58 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Benard @ 2010-01-11 14:32 UTC (permalink / raw)
  To: s.hauer; +Cc: barebox

From: Eric Benard <ebenard@1720eb.(none)>

edev was allocated using malloc. On one board (NOR boot), we met data abort
in eth_register (at dev_add_param(dev, &edev->param_ip);).
Allocating edev with xzalloc (as in several other drivers) fixed the problem.

Signed-off-by: Eric Benard <eric@eukrea.com>
---
 drivers/net/fec_imx.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/fec_imx.c b/drivers/net/fec_imx.c
index 4893291..49140e7 100644
--- a/drivers/net/fec_imx.c
+++ b/drivers/net/fec_imx.c
@@ -542,7 +542,7 @@ static int fec_probe(struct device_d *dev)
 #ifdef CONFIG_ARCH_IMX27
 	PCCR0 |= PCCR0_FEC_EN;
 #endif
-        edev = (struct eth_device *)malloc(sizeof(struct eth_device));
+        edev = (struct eth_device *)xzalloc(sizeof(struct eth_device));
         dev->type_data = edev;
 	fec = (struct fec_priv *)malloc(sizeof(*fec));
         edev->priv = fec;
-- 
1.6.3.3


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-01-11 17:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-11 14:32 [PATCH] Fix a data abort with fec_imx Eric Benard
2010-01-11 17:58 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox