* [PATCH] RxRPC: Fix kcalloc parameters swapped
@ 2012-02-14 6:19 Axel Lin
2012-02-14 16:03 ` David Howells
0 siblings, 1 reply; 3+ messages in thread
From: Axel Lin @ 2012-02-14 6:19 UTC (permalink / raw)
To: linux-kernel
Cc: David S. Miller, David Howells, Mimi Zohar, Thomas Meyer,
Anton Blanchard, netdev
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(-)
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;
--
1.7.5.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] RxRPC: Fix kcalloc parameters swapped
2012-02-14 6:19 [PATCH] RxRPC: Fix kcalloc parameters swapped Axel Lin
@ 2012-02-14 16:03 ` David Howells
2012-02-14 19:42 ` David Miller
0 siblings, 1 reply; 3+ messages in thread
From: David Howells @ 2012-02-14 16:03 UTC (permalink / raw)
To: Axel Lin
Cc: dhowells, linux-kernel, David S. Miller, Mimi Zohar, Thomas Meyer,
Anton Blanchard, netdev
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>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] RxRPC: Fix kcalloc parameters swapped
2012-02-14 16:03 ` David Howells
@ 2012-02-14 19:42 ` David Miller
0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2012-02-14 19:42 UTC (permalink / raw)
To: dhowells; +Cc: axel.lin, linux-kernel, zohar, thomas, anton, netdev
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.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-02-14 19:43 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-14 6:19 [PATCH] RxRPC: Fix kcalloc parameters swapped Axel Lin
2012-02-14 16:03 ` David Howells
2012-02-14 19:42 ` David Miller
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).