From 3749decc830c7f53827bcfe0d2ea448a0870e890 Mon Sep 17 00:00:00 2001 From: Tobias Diedrich Date: Mon, 19 Oct 2015 19:36:59 +0200 Subject: [PATCH] Fix memory initialization in ag7240.c Only the first sizeof(ptr) bytes were initialized correctly. This leads to a crash in ag7250_send() if mac->next_tx is uninitialized (if the memory returned by malloc() is not nulled). --- u-boot/cpu/mips/ar7240/ag7240.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/u-boot/cpu/mips/ar7240/ag7240.c b/u-boot/cpu/mips/ar7240/ag7240.c index 191da09..6f5a33e 100644 --- a/u-boot/cpu/mips/ar7240/ag7240.c +++ b/u-boot/cpu/mips/ar7240/ag7240.c @@ -535,8 +535,8 @@ int ag7240_enet_initialize(bd_t * bis) { return 0; } - memset(ag7240_macs[i], 0, sizeof(ag7240_macs[i])); - memset(dev[i], 0, sizeof(dev[i])); + memset(ag7240_macs[i], 0, sizeof(*ag7240_macs[i])); + memset(dev[i], 0, sizeof(*dev[i])); sprintf(dev[i]->name, "eth%d", i); ag7240_get_ethaddr(dev[i]); -- 2.25.1