From 10e94b251c43f195616266a9f3d16964057b72ba Mon Sep 17 00:00:00 2001 From: juhosg Date: Wed, 12 Mar 2014 12:52:36 +0000 Subject: [PATCH] ar71xx: ar934x_nfc: fix memory initialization bug MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit sizeof(array_from_function_definition) gives back the size of the pointer. sizeof(type) * array_size should be used in memset. Signed-off-by: David Völgyes Patchwork: http://patchwork.openwrt.org/patch/4950/ Signed-off-by: Gabor Juhos git-svn-id: svn://svn.openwrt.org/openwrt/trunk@39890 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- target/linux/ar71xx/files/arch/mips/ath79/dev-nfc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/ar71xx/files/arch/mips/ath79/dev-nfc.c b/target/linux/ar71xx/files/arch/mips/ath79/dev-nfc.c index d140cd0eab..9b5256ecc2 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/dev-nfc.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/dev-nfc.c @@ -43,7 +43,7 @@ static void __init ath79_nfc_init_resource(struct resource res[2], unsigned long size, int irq) { - memset(res, 0, sizeof(res)); + memset(res, 0, sizeof(struct resource) * 2); res[0].flags = IORESOURCE_MEM; res[0].start = base; -- 2.11.0