From: Fabian Frederick Date: Mon, 13 Oct 2014 22:53:29 +0000 (-0700) Subject: fs/reiserfs/journal.c: fix sparse context imbalance warning X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=54cc6cea73bb5ddf0362a70ef58816898bfb7f87;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git fs/reiserfs/journal.c: fix sparse context imbalance warning Merge conditional unlock/lock in the same condition to avoid sparse warning: fs/reiserfs/journal.c:703:36: warning: context imbalance in 'add_to_chunk' - unexpected unlock Signed-off-by: Fabian Frederick Cc: Jeff Mahoney Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/reiserfs/journal.c b/fs/reiserfs/journal.c index a88b1b3e7db3..d571e173a990 100644 --- a/fs/reiserfs/journal.c +++ b/fs/reiserfs/journal.c @@ -699,11 +699,13 @@ static int add_to_chunk(struct buffer_chunk *chunk, struct buffer_head *bh, chunk->bh[chunk->nr++] = bh; if (chunk->nr >= CHUNK_SIZE) { ret = 1; - if (lock) + if (lock) { spin_unlock(lock); - fn(chunk); - if (lock) + fn(chunk); spin_lock(lock); + } else { + fn(chunk); + } } return ret; }