summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGustavo A. R. Silva <gustavo@embeddedor.com>2019-08-30 16:04:43 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2019-08-30 18:00:50 -0700
commit14108b9131a47ff18a3c640f583eb2d625c75c0d (patch)
treeec68f31eede2441acc795a3a80e9666561fad740
parentb4c46484dc3fa3721d68fdfae85c1d7b1f6b5472 (diff)
downloadlinux-stable-14108b9131a47ff18a3c640f583eb2d625c75c0d.tar.gz
linux-stable-14108b9131a47ff18a3c640f583eb2d625c75c0d.tar.bz2
linux-stable-14108b9131a47ff18a3c640f583eb2d625c75c0d.zip
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> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--mm/z3fold.c1
1 files changed, 1 insertions, 0 deletions
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);