Patchwork [U-Boot,05/10,v2] net: fec_mxc: Add initialized eth_device structure

login
register
mail settings
Submitter Nobuhiro Iwamatsu
Date Oct. 19, 2010, 5:03 a.m.
Message ID <1287464627-12302-5-git-send-email-iwamatsu@nigauri.org>
Download mbox | patch
Permalink /patch/71876/
State Accepted
Commit de0b95762a048a6815cd019b3a0e1acf0dbd70f4
Headers show

Comments

Nobuhiro Iwamatsu - Oct. 19, 2010, 5:03 a.m.
This prevents access to the member of eth_device which is not initialized.

Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
CC: Ben Warren <biggerbadderben@gmail.com>
---
 drivers/net/fec_mxc.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

Patch

diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c
index 2d4ffed..071276e 100644
--- a/drivers/net/fec_mxc.c
+++ b/drivers/net/fec_mxc.c
@@ -707,6 +707,7 @@  static int fec_probe(bd_t *bd)
 		puts("fec_mxc: not enough malloc memory\n");
 		return -ENOMEM;
 	}
+	memset(edev, 0, sizeof(*edev));
 	edev->priv = fec;
 	edev->init = fec_init;
 	edev->send = fec_send;