Skip to content

Commit 03c90af

Browse files
committed
block/blk-iocost: ensure 'ret' is set on error
In case blkg_conf_open_bdev_frozen() fails, ioc_qos_write() jumps to the error path without assigning a value to 'ret'. Ensure that it inherits the error from the passed back error value. Reported-by: kernel test robot <[email protected]> Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/ Fixes: 9730763 ("block: correct locking order for protecting blk-wbt parameters") Signed-off-by: Jens Axboe <[email protected]>
1 parent 9730763 commit 03c90af

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

block/blk-iocost.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3229,8 +3229,10 @@ static ssize_t ioc_qos_write(struct kernfs_open_file *of, char *input,
32293229
blkg_conf_init(&ctx, input);
32303230

32313231
memflags = blkg_conf_open_bdev_frozen(&ctx);
3232-
if (IS_ERR_VALUE(memflags))
3232+
if (IS_ERR_VALUE(memflags)) {
3233+
ret = memflags;
32333234
goto err;
3235+
}
32343236

32353237
body = ctx.body;
32363238
disk = ctx.bdev->bd_disk;

0 commit comments

Comments
 (0)