diff options
author | Mikulas Patocka <mpatocka@redhat.com> | 2022-08-08 10:50:10 -0400 |
---|---|---|
committer | Mike Snitzer <snitzer@kernel.org> | 2022-08-09 19:20:23 -0400 |
commit | b7f362d6413ebd0167ac5a9f09ad5dca5490ac1a (patch) | |
tree | 60fcf0216b21e3d3d08e9f66fcced5f08413e645 | |
parent | f876df9f12cda68e68995b33b36491d78fd3ecce (diff) | |
download | linux-stable-b7f362d6413ebd0167ac5a9f09ad5dca5490ac1a.tar.gz linux-stable-b7f362d6413ebd0167ac5a9f09ad5dca5490ac1a.tar.bz2 linux-stable-b7f362d6413ebd0167ac5a9f09ad5dca5490ac1a.zip |
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: df699cc16ea5e ("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>
-rw-r--r-- | drivers/md/dm-writecache.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/md/dm-writecache.c b/drivers/md/dm-writecache.c index ead008ea38f2..03fe2c5d5e32 100644 --- a/drivers/md/dm-writecache.c +++ b/drivers/md/dm-writecache.c @@ -1598,7 +1598,8 @@ done: default: BUG(); - return -1; + wc_unlock(wc); + return DM_MAPIO_KILL; } } |