Re: [PATCH 3/4] taskstats: reuse na in cgroupstats_user_cmd()

From: Balbir Singh

Date: Sun Nov 01 2026 - 21:54:20 EST


On 11/1/26 11:57 AM, Bradley Morgan wrote:
> cgroupstats_user_cmd() already pulled CGROUPSTATS_CMD_ATTR_FD into na to
> check that the user sent it, then indexes info->attrs[] a second time to
> read the value out of the very same attribute. Read it from na.
>
> No functional change.
>
> Signed-off-by: Bradley Morgan <brads@xxxxxxxxxxxxxx>
> ---
> kernel/taskstats.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/taskstats.c b/kernel/taskstats.c
> index 35e9fa71526cc..9e11f92216861 100644
> --- a/kernel/taskstats.c
> +++ b/kernel/taskstats.c
> @@ -417,7 +417,7 @@ static int cgroupstats_user_cmd(struct sk_buff *skb, struct genl_info *info)
> if (!na)
> return -EINVAL;
>
> - fd = nla_get_u32(info->attrs[CGROUPSTATS_CMD_ATTR_FD]);
> + fd = nla_get_u32(na);
> CLASS(fd, f)(fd);
> if (fd_empty(f))
> return -EBADF;

Reviewed-by: Balbir Singh <balbirs@xxxxxxxxxx>