taskstats: drop the dead NULL attribute check in parse()

Patch series "taskstats: tidy up the cpumask command path".

Two small cleanups from reading kernel/taskstats.c. No functional change in
either one.


This patch (of 2):

taskstats_user_cmd() only calls the cpumask handlers after checking the
same info->attrs[] entry, so parse() never sees a NULL attribute.  Drop
the check and its odd "return 1", which no caller tested for anyway.

No functional change.

Link: https://lore.kernel.org/20260728202104.17839-1-include@grrlz.net
Link: https://lore.kernel.org/20260728202104.17839-2-include@grrlz.net
Signed-off-by: Bradley Morgan <include@grrlz.net>
Cc: Balbir Singh <bsingharora@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
Bradley Morgan
2026-07-28 20:21:03 +00:00
committed by Andrew Morton
parent 1a1b9b0270
commit 36ffbe1d5e

View File

@@ -361,8 +361,6 @@ static int parse(struct nlattr *na, struct cpumask *mask)
int len;
int ret;
if (na == NULL)
return 1;
len = nla_len(na);
if (len > TASKSTATS_CPUMASK_MAXLEN)
return -E2BIG;