Skip to content

Commit

Permalink
cgroup-v1: Return length if its <= 1 in pidlist_uniq
Browse files Browse the repository at this point in the history
Signed-off-by: Santhosh <santhosh.user.why.red@gmail.com>
  • Loading branch information
user-why-red committed Jun 13, 2024
1 parent 2f9f3a7 commit 625bab7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/cgroup/cgroup-v1.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ static int pidlist_uniq(pid_t *list, int length)
* we presume the 0th element is unique, so i starts at 1. trivial
* edge cases first; no work needs to be done for either
*/
if (length == 0 || length == 1)
if (length <= 1)
return length;
/* src and dest walk down the list; dest counts unique elements */
for (src = 1; src < length; src++) {
Expand Down

0 comments on commit 625bab7

Please sign in to comment.