Skip to content

Commit

Permalink
mm/z3fold.c: fix lock/unlock imbalance in z3fold_page_isolate
Browse files Browse the repository at this point in the history
commit 14108b9 upstream.

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: d776aaa ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Gustavo A. R. Silva authored and Greg Kroah-Hartman committed Sep 19, 2019
1 parent 1894d85 commit 7c218eb
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions mm/z3fold.c
Original file line number Diff line number Diff line change
Expand Up @@ -1408,6 +1408,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);
Expand Down

0 comments on commit 7c218eb

Please sign in to comment.