Commit b7f362d6 authored by Mikulas Patocka's avatar Mikulas Patocka Committed by Mike Snitzer
Browse files

dm writecache: fix smatch warning about invalid return from writecache_map



There's a smatch warning "inconsistent returns '&wc->lock'" in
dm-writecache. The reason for the warning is that writecache_map()
doesn't drop the lock on the impossible path.

Fix this warning by adding wc_unlock() after the BUG statement (so
that it will be compiled-away anyway).

Fixes: df699cc1 ("dm writecache: report invalid return from writecache_map helpers")
Reported-by: default avatarkernel test robot <lkp@intel.com>
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
Signed-off-by: default avatarMike Snitzer <snitzer@kernel.org>
parent f876df9f
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -1598,7 +1598,8 @@ static int writecache_map(struct dm_target *ti, struct bio *bio)


	default:
	default:
		BUG();
		BUG();
		return -1;
		wc_unlock(wc);
		return DM_MAPIO_KILL;
	}
	}
}
}