[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <for-27-patch8-2@bga.com>
Date: Thu, 10 Jul 2008 16:25:33 -0500 (CDT)
From: Milton Miller <miltonm@....com>
To: <netdev@...r.kernel.org>
Cc: linux-kernel@...r.org, Andrew Morton <akpm@...ux-foundation.org>
Subject: [PATCH] tcp: correct kcalloc usage
kcalloc is supposed to be called with the count as its first argument and
the element size as the second.
Signed-off-by: Milton Miller <miltonm@....com>
---
Both arguments are size_t so does not affect correctness. This
callsite is during module_init and therefore not performance critical.
Another patch will optimize the case when the count is variable but
the size is fixed.
diff --git a/net/ipv4/tcp_probe.c b/net/ipv4/tcp_probe.c
index 5ff0ce6..7ddc30f 100644
--- a/net/ipv4/tcp_probe.c
+++ b/net/ipv4/tcp_probe.c
@@ -224,7 +224,7 @@ static __init int tcpprobe_init(void)
if (bufsize < 0)
return -EINVAL;
- tcp_probe.log = kcalloc(sizeof(struct tcp_log), bufsize, GFP_KERNEL);
+ tcp_probe.log = kcalloc(bufsize, sizeof(struct tcp_log), GFP_KERNEL);
if (!tcp_probe.log)
goto err0;
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists