Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202503200454.QWpwKeJu-lkp@intel.com/
Fixes: 9730763f4756 ("block: correct locking order for protecting blk-wbt parameters")
Signed-off-by: Jens Axboe <axboe@kernel.dk>

+3 -1
+3 -1
block/blk-iocost.c
··· 3229 3229 blkg_conf_init(&ctx, input); 3230 3230 3231 3231 memflags = blkg_conf_open_bdev_frozen(&ctx); 3232 - if (IS_ERR_VALUE(memflags)) 3232 + if (IS_ERR_VALUE(memflags)) { 3233 + ret = memflags; 3233 3234 goto err; 3235 + } 3234 3236 3235 3237 body = ctx.body; 3236 3238 disk = ctx.bdev->bd_disk;