提交 f65bd5ec 编写于 作者: A Axel Lin 提交者: David S. Miller

RxRPC: Fix kcalloc parameters swapped

The first parameter should be "number of elements" and the second parameter
should be "element size".
Signed-off-by: NAxel Lin <axel.lin@gmail.com>
Acked-by: NDavid Howells <dhowells@redhat.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 fc543637
...@@ -232,7 +232,7 @@ static int rxrpc_krb5_decode_principal(struct krb5_principal *princ, ...@@ -232,7 +232,7 @@ static int rxrpc_krb5_decode_principal(struct krb5_principal *princ,
if (toklen <= (n_parts + 1) * 4) if (toklen <= (n_parts + 1) * 4)
return -EINVAL; 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) if (!princ->name_parts)
return -ENOMEM; return -ENOMEM;
...@@ -355,7 +355,7 @@ static int rxrpc_krb5_decode_tagged_array(struct krb5_tagged_data **_td, ...@@ -355,7 +355,7 @@ static int rxrpc_krb5_decode_tagged_array(struct krb5_tagged_data **_td,
_debug("n_elem %d", n_elem); _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); GFP_KERNEL);
if (!td) if (!td)
return -ENOMEM; return -ENOMEM;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册