From mboxrd@z Thu Jan 1 00:00:00 1970 From: Milton Miller Subject: [PATCH] tcp: correct kcalloc usage Date: Thu, 10 Jul 2008 16:25:33 -0500 (CDT) Message-ID: References: Cc: linux-kernel@vger.org, Andrew Morton To: Return-path: Received: from sullivan.realtime.net ([205.238.132.226]:1242 "EHLO sullivan.realtime.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753290AbYGJVjw (ORCPT ); Thu, 10 Jul 2008 17:39:52 -0400 In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: 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 --- 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;