mirror of
https://github.com/torvalds/linux.git
synced 2026-06-02 11:33:28 +02:00
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: df699cc16e ("dm writecache: report invalid return from writecache_map helpers")
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@kernel.org>
This commit is contained in:
parent
f876df9f12
commit
b7f362d641
|
|
@ -1598,7 +1598,8 @@ static int writecache_map(struct dm_target *ti, struct bio *bio)
|
|||
|
||||
default:
|
||||
BUG();
|
||||
return -1;
|
||||
wc_unlock(wc);
|
||||
return DM_MAPIO_KILL;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user