summaryrefslogtreecommitdiffstats
path: root/drivers/block/null_blk_zoned.c
diff options
context:
space:
mode:
authorKeith Busch <kbusch@kernel.org>2019-10-09 17:38:13 +0200
committerJens Axboe <axboe@kernel.dk>2019-10-10 05:00:20 +0200
commit79a85e214d62da9a750cc63ef49483e62abbda81 (patch)
tree2949c2de17ef47047ab7d6447c29c8b433fe3053 /drivers/block/null_blk_zoned.c
parentio_uring: only flush workqueues on fileset removal (diff)
downloadlinux-79a85e214d62da9a750cc63ef49483e62abbda81.tar.xz
linux-79a85e214d62da9a750cc63ef49483e62abbda81.zip
null_blk: Fix zoned command return code
The return code from null_handle_zoned() sets the cmd->error value. Returning OK status when an error occured overwrites the intended cmd->error. Return the appropriate error code instead of setting the error in the cmd. Fixes: fceb5d1b19cbe626 ("null_blk: create a helper for zoned devices") Cc: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com> Signed-off-by: Keith Busch <kbusch@kernel.org> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/block/null_blk_zoned.c')
-rw-r--r--drivers/block/null_blk_zoned.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/block/null_blk_zoned.c b/drivers/block/null_blk_zoned.c
index eabc116832a7..3d7fdea872f8 100644
--- a/drivers/block/null_blk_zoned.c
+++ b/drivers/block/null_blk_zoned.c
@@ -142,8 +142,7 @@ static blk_status_t null_zone_reset(struct nullb_cmd *cmd, sector_t sector)
zone->wp = zone->start;
break;
default:
- cmd->error = BLK_STS_NOTSUPP;
- break;
+ return BLK_STS_NOTSUPP;
}
return BLK_STS_OK;
}