diff mbox

RxRPC: Fix kcalloc parameters swapped

Message ID 1329200354.3806.1.camel@phoenix
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Axel Lin Feb. 14, 2012, 6:19 a.m. UTC
The first parameter should be "number of elements" and the second parameter
should be "element size".

Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
 net/rxrpc/ar-key.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Comments

David Howells Feb. 14, 2012, 4:03 p.m. UTC | #1
Axel Lin <axel.lin@gmail.com> wrote:

> The first parameter should be "number of elements" and the second parameter
> should be "element size".
> 
> Signed-off-by: Axel Lin <axel.lin@gmail.com>

Not that it matters, I think, but let's be consistent...

Acked-by: David Howells <dhowells@redhat.com>
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller Feb. 14, 2012, 7:42 p.m. UTC | #2
From: David Howells <dhowells@redhat.com>
Date: Tue, 14 Feb 2012 16:03:28 +0000

> Axel Lin <axel.lin@gmail.com> wrote:
> 
>> The first parameter should be "number of elements" and the second parameter
>> should be "element size".
>> 
>> Signed-off-by: Axel Lin <axel.lin@gmail.com>
> 
> Not that it matters, I think, but let's be consistent...
> 
> Acked-by: David Howells <dhowells@redhat.com>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/rxrpc/ar-key.c b/net/rxrpc/ar-key.c
index 4cba13e..ae3a035 100644
--- a/net/rxrpc/ar-key.c
+++ b/net/rxrpc/ar-key.c
@@ -232,7 +232,7 @@  static int rxrpc_krb5_decode_principal(struct krb5_principal *princ,
 	if (toklen <= (n_parts + 1) * 4)
 		return -EINVAL;
 
-	princ->name_parts = kcalloc(sizeof(char *), n_parts, GFP_KERNEL);
+	princ->name_parts = kcalloc(n_parts, sizeof(char *), GFP_KERNEL);
 	if (!princ->name_parts)
 		return -ENOMEM;
 
@@ -355,7 +355,7 @@  static int rxrpc_krb5_decode_tagged_array(struct krb5_tagged_data **_td,
 
 		_debug("n_elem %d", n_elem);
 
-		td = kcalloc(sizeof(struct krb5_tagged_data), n_elem,
+		td = kcalloc(n_elem, sizeof(struct krb5_tagged_data),
 			     GFP_KERNEL);
 		if (!td)
 			return -ENOMEM;