linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xtensa: net: fix invalid use of sizeof in iss_net_setup()
@ 2013-03-14 14:06 Wei Yongjun
  2013-03-15  3:02 ` Max Filippov
  0 siblings, 1 reply; 2+ messages in thread
From: Wei Yongjun @ 2013-03-14 14:06 UTC (permalink / raw)
  To: chris, jcmvbkbc; +Cc: yongjun_wei, linux-xtensa, linux-kernel

From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

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 <yongjun_wei@trendmicro.com.cn>
---
 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;
 	}



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] xtensa: net: fix invalid use of sizeof in iss_net_setup()
  2013-03-14 14:06 [PATCH] xtensa: net: fix invalid use of sizeof in iss_net_setup() Wei Yongjun
@ 2013-03-15  3:02 ` Max Filippov
  0 siblings, 0 replies; 2+ messages in thread
From: Max Filippov @ 2013-03-15  3:02 UTC (permalink / raw)
  To: Wei Yongjun; +Cc: chris, yongjun_wei, linux-xtensa, linux-kernel

On Thu, Mar 14, 2013 at 6:06 PM, Wei Yongjun <weiyj.lk@gmail.com> wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>
> 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 <yongjun_wei@trendmicro.com.cn>
> ---
>  arch/xtensa/platforms/iss/network.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Acked-by: Max Filippov <jcmvbkbc@gmail.com>

-- 
Thanks.
-- Max

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-03-15  3:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-14 14:06 [PATCH] xtensa: net: fix invalid use of sizeof in iss_net_setup() Wei Yongjun
2013-03-15  3:02 ` Max Filippov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).