linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/z3fold.c: fix lock/unlock imbalance in z3fold_page_isolate
@ 2019-08-26  3:06 Gustavo A. R. Silva
  2019-08-26 23:05 ` Andrew Morton
  0 siblings, 1 reply; 3+ messages in thread
From: Gustavo A. R. Silva @ 2019-08-26  3:06 UTC (permalink / raw)
  To: Andrew Morton, Henry Burns; +Cc: linux-mm, linux-kernel, Gustavo A. R. Silva

Fix lock/unlock imbalance by unlocking *zhdr* before return.

Addresses-Coverity-ID: 1452811 ("Missing unlock")
Fixes: d776aaa9895e ("mm/z3fold.c: fix race between migration and destruction")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
 mm/z3fold.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/mm/z3fold.c b/mm/z3fold.c
index e31cd9bd4ed5..75b7962439ff 100644
--- a/mm/z3fold.c
+++ b/mm/z3fold.c
@@ -1406,6 +1406,7 @@ static bool z3fold_page_isolate(struct page *page, isolate_mode_t mode)
 				 * should freak out.
 				 */
 				WARN(1, "Z3fold is experiencing kref problems\n");
+				z3fold_page_unlock(zhdr);
 				return false;
 			}
 			z3fold_page_unlock(zhdr);
-- 
2.23.0



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-08-29 19:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-26  3:06 [PATCH] mm/z3fold.c: fix lock/unlock imbalance in z3fold_page_isolate Gustavo A. R. Silva
2019-08-26 23:05 ` Andrew Morton
2019-08-29 19:14   ` Gustavo A. R. Silva

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).