commit | dab8dfff49a673a4b070ad3f44534b3c0e88a189 | [log] [tgz] |
---|---|---|
author | Miaohe Lin <[email protected]> | Thu May 19 14:08:51 2022 -0700 |
committer | akpm <[email protected]> | Thu May 19 14:08:51 2022 -0700 |
tree | 67c673013b8adc9e0849ff42d6561d14522cf3e1 | |
parent | f19c25684c3e19b329e0498dd6d601df13c33223 [diff] [blame] |
mm/swap: remove unneeded p != NULL check in __swap_duplicate If p is NULL, __swap_duplicate will already return -EINVAL. So if we reach here, p must be non-NULL. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Miaohe Lin <[email protected]> Reviewed-by: David Hildenbrand <[email protected]> Reviewed-by: Oscar Salvador <[email protected]> Cc: Alistair Popple <[email protected]> Cc: David Howells <[email protected]> Cc: Matthew Wilcox <[email protected]> Cc: Naoya Horiguchi <[email protected]> Cc: NeilBrown <[email protected]> Cc: Peter Xu <[email protected]> Cc: Suren Baghdasaryan <[email protected]> Cc: Vlastimil Babka <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
diff --git a/mm/swapfile.c b/mm/swapfile.c index f59abca..e67adda 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c
@@ -3333,8 +3333,7 @@ static int __swap_duplicate(swp_entry_t entry, unsigned char usage) unlock_out: unlock_cluster_or_swap_info(p, ci); - if (p) - put_swap_device(p); + put_swap_device(p); return err; }