Skip to content

Commit

Permalink
RxRPC: Fix kcalloc parameters swapped
Browse files Browse the repository at this point in the history
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>
Acked-by: David Howells <dhowells@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Axel Lin authored and David S. Miller committed Feb 14, 2012
1 parent fc54363 commit f65bd5e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/rxrpc/ar-key.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit f65bd5e

Please sign in to comment.