Skip to contentSkip to conversation

mm-swapfilec-remove-unnecessary-out-label-in-__swap_duplicate.patch removed from -mm tree

merged [email protected] 1 participant 1 message Dec 16, 2020

lore
Share & tools
lore

[email protected]

author tree notice Applied
#0 lore raw

The patch titled
Subject: mm/swapfile.c: remove unnecessary out label in __swap_duplicate()
has been removed from the -mm tree. Its filename was
mm-swapfilec-remove-unnecessary-out-label-in-__swap_duplicate.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: Miaohe Lin <[email protected]>
Subject: mm/swapfile.c: remove unnecessary out label in __swap_duplicate()

When the code went to the out label, it must have p == NULL. So what out label really does is redundant if check and return err. We should Remove this unnecessary out label because it does not handle resource free and so on.

---

 mm/swapfile.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
mm/swapfile.c renamed from mm/swapfile.c~mm-swapfilec-remove-unnecessary-out-label-in-__swap_duplicate +2 -3
@@ -3445,11 +3445,11 @@ static int __swap_duplicate(swp_entry_t
 	unsigned long offset;
 	unsigned char count;
 	unsigned char has_cache;
-	int err = -EINVAL;
+	int err;
 
 	p = get_swap_device(entry);
 	if (!p)
-		goto out;
+		return -EINVAL;
 
 	offset = swp_offset(entry);
 	ci = lock_cluster_or_swap_info(p, offset);
@@ -3496,7 +3496,6 @@ static int __swap_duplicate(swp_entry_t
 
 unlock_out:
 	unlock_cluster_or_swap_info(p, ci);
-out:
 	if (p)
 		put_swap_device(p);
 	return err;

_

Patches currently in -mm which might be from [email protected] are