OpenCloudOS-Kernel/drivers/block/null_blk
Damien Le Moal e0aba0c6d5 null_blk: Fix return value of nullb_device_power_store()
commit d9ff882b54f99f96787fa3df7cd938966843c418 upstream.

When powering on a null_blk device that is not already on, the return
value ret that is initialized to be count is reused to check the return
value of null_add_dev(), leading to nullb_device_power_store() to return
null_add_dev() return value (0 on success) instead of "count".
So make sure to set ret to be equal to count when there are no errors.

Fixes: a2db328b0839 ("null_blk: fix null-ptr-dereference while configuring 'power' and 'submit_queues'")
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Yu Kuai <yukuai3@huawei.com>
Reviewed-by: Kanchan Joshi <joshi.k@samsung.com>
Link: https://lore.kernel.org/r/20240527043445.235267-1-dlemoal@kernel.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-10-10 11:58:09 +02:00
..
Kconfig block: null_blk: make fault-injection dynamically configurable per device 2023-04-13 07:38:55 -06:00
Makefile
main.c null_blk: Fix return value of nullb_device_power_store() 2024-10-10 11:58:09 +02:00
null_blk.h block: null_blk: make fault-injection dynamically configurable per device 2023-04-13 07:38:55 -06:00
trace.c
trace.h treewide: Rename enum req_opf into enum req_op 2022-07-14 12:14:30 -06:00
zoned.c null_blk: Do not allow runt zone with zone capacity smaller then zone size 2024-07-11 12:49:22 +02:00