From: Tobias Diedrich Date: Mon, 19 Oct 2015 17:36:59 +0000 (+0200) Subject: Fix memory initialization in ag7240.c X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=3749decc830c7f53827bcfe0d2ea448a0870e890;p=oweals%2Fu-boot_mod.git 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). --- 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]);