9
0
Fork 0

Fix a data abort with fec_imx

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>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Eric Benard 2010-01-11 15:32:15 +01:00 committed by Sascha Hauer
parent b36552fafd
commit faa8f98ea7
1 changed files with 1 additions and 1 deletions

View File

@ -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;