ar71xx: ar934x_nfc: fix memory initialization bug

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 <david.volgyes@gmail.com>
Patchwork: http://patchwork.openwrt.org/patch/4950/
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>

SVN-Revision: 39890
master
Gabor Juhos 11 years ago
parent 24095302aa
commit 25e870eed6
  1. 2
      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, unsigned long size,
int irq) int irq)
{ {
memset(res, 0, sizeof(res)); memset(res, 0, sizeof(struct resource) * 2);
res[0].flags = IORESOURCE_MEM; res[0].flags = IORESOURCE_MEM;
res[0].start = base; res[0].start = base;

Loading…
Cancel
Save