RxRPC: Fix kcalloc parameters swapped
Subsystems (3)
PATCH 1/1 RxRPC: Fix kcalloc parameters swapped
The first parameter should be "number of elements" and the second parameter should be "element size".
Signed-off-by Axel Lin <[email protected]>
--- net/rxrpc/ar-key.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
net/rxrpc/ar-key.c +2 -2
@@ -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 ;
Signature · 1 line
1.7.5.4
Quoted 4 lines · Axel Lin
The first parameter should be "number of elements" and the second parameter should be "element size".
Signed-off-by Axel Lin <[email protected]>
Not that it matters, I think, but let's be consistent...
Acked-by David Howells <[email protected]>
From: David Howells <[email protected]>
Date: Tue, 14 Feb 2012 16:03:28 +0000
Quoted 10 lines
Quoted 4 lines · Axel Lin
The first parameter should be "number of elements" and the second parameter should be "element size".
Signed-off-by Axel Lin <[email protected]>Not that it matters, I think, but let's be consistent...
Acked-by David Howells <[email protected]>
Applied.