]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blobdiff - mm/swapfile.c
mm/swapfile.c: swap_next should increase position index
[mirror_ubuntu-jammy-kernel.git] / mm / swapfile.c
index bb3261d45b6a3ea6af720bee1abd0bc9a7a3e34e..6febae9ad3cd14424cc147134c848a996807a5d2 100644 (file)
@@ -2737,10 +2737,10 @@ static void *swap_next(struct seq_file *swap, void *v, loff_t *pos)
        else
                type = si->type + 1;
 
+       ++(*pos);
        for (; (si = swap_type_to_swap_info(type)); type++) {
                if (!(si->flags & SWP_USED) || !si->swap_map)
                        continue;
-               ++*pos;
                return si;
        }