Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757120Ab3CNOGr (ORCPT ); Thu, 14 Mar 2013 10:06:47 -0400 Received: from mail-bk0-f49.google.com ([209.85.214.49]:41970 "EHLO mail-bk0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756661Ab3CNOGq (ORCPT ); Thu, 14 Mar 2013 10:06:46 -0400 MIME-Version: 1.0 Date: Thu, 14 Mar 2013 22:06:45 +0800 Message-ID: Subject: [PATCH] xtensa: net: fix invalid use of sizeof in iss_net_setup() From: Wei Yongjun To: chris@zankel.net, jcmvbkbc@gmail.com Cc: yongjun_wei@trendmicro.com.cn, linux-xtensa@linux-xtensa.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1000 Lines: 30 From: Wei Yongjun sizeof() when applied to a pointer typed expression gives the size of the pointer, not that of the pointed data. Signed-off-by: Wei Yongjun --- arch/xtensa/platforms/iss/network.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/xtensa/platforms/iss/network.c b/arch/xtensa/platforms/iss/network.c index 7d0fea6..da56fec 100644 --- a/arch/xtensa/platforms/iss/network.c +++ b/arch/xtensa/platforms/iss/network.c @@ -737,7 +737,7 @@ static int iss_net_setup(char *str) return 1; } - if ((new = alloc_bootmem(sizeof new)) == NULL) { + if ((new = alloc_bootmem(sizeof(*new)) == NULL) { printk("Alloc_bootmem failed\n"); return 1; } -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/