diff mbox series

[4/7] mm/z3fold.c: fix lock/unlock imbalance in z3fold_page_isolate

Message ID 20190830230443.qFvaKz7QH%akpm@linux-foundation.org (mailing list archive)
State New, archived
Headers show
Series [1/7] mm: memcontrol: flush percpu slab vmstats on kmem offlining | expand

Commit Message

Andrew Morton Aug. 30, 2019, 11:04 p.m. UTC
From: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
Subject: mm/z3fold.c: fix lock/unlock imbalance in z3fold_page_isolate

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

Addresses Coverity ID 1452811 ("Missing unlock")

Link: http://lkml.kernel.org/r/20190826030634.GA4379@embeddedor
Fixes: d776aaa9895e ("mm/z3fold.c: fix race between migration and destruction")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Henry Burns <henrywolfeburns@gmail.com>
Cc: Vitaly Wool <vitalywool@gmail.com>
Cc: Shakeel Butt <shakeelb@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/z3fold.c |    1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

--- a/mm/z3fold.c~mm-z3foldc-fix-lock-unlock-imbalance-in-z3fold_page_isolate
+++ a/mm/z3fold.c
@@ -1406,6 +1406,7 @@  static bool z3fold_page_isolate(struct p
 				 * should freak out.
 				 */
 				WARN(1, "Z3fold is experiencing kref problems\n");
+				z3fold_page_unlock(zhdr);
 				return false;
 			}
 			z3fold_page_unlock(zhdr);