aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cdx/controller/mcdi_functions.c
diff options
context:
space:
mode:
authorJosef Bacik <[email protected]>2023-09-05 16:15:23 +0000
committerDavid Sterba <[email protected]>2023-09-21 16:52:20 +0000
commit20218dfbaa31b8d3ef842fafcc7eb4c6aa03f80a (patch)
tree3e6af844981424f93aad1f799e7b053d46926e3d /drivers/cdx/controller/mcdi_functions.c
parentbtrfs: reset destination buffer when read_extent_buffer() gets invalid range (diff)
downloadkernel-20218dfbaa31b8d3ef842fafcc7eb4c6aa03f80a.tar.gz
kernel-20218dfbaa31b8d3ef842fafcc7eb4c6aa03f80a.zip
btrfs: make sure to initialize start and len in find_free_dev_extent
Jens reported a compiler error when using CONFIG_CC_OPTIMIZE_FOR_SIZE=y that looks like this In function ‘gather_device_info’, inlined from ‘btrfs_create_chunk’ at fs/btrfs/volumes.c:5507:8: fs/btrfs/volumes.c:5245:48: warning: ‘dev_offset’ may be used uninitialized [-Wmaybe-uninitialized] 5245 | devices_info[ndevs].dev_offset = dev_offset; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~ fs/btrfs/volumes.c: In function ‘btrfs_create_chunk’: fs/btrfs/volumes.c:5196:13: note: ‘dev_offset’ was declared here 5196 | u64 dev_offset; This occurs because find_free_dev_extent is responsible for setting dev_offset, however if we get an -ENOMEM at the top of the function we'll return without setting the value. This isn't actually a problem because we will see the -ENOMEM in gather_device_info() and return and not use the uninitialized value, however we also just don't want the compiler warning so rework the code slightly in find_free_dev_extent() to make sure it's always setting *start and *len to avoid the compiler warning. Reported-by: Jens Axboe <[email protected]> Tested-by: Jens Axboe <[email protected]> Reviewed-by: Qu Wenruo <[email protected]> Signed-off-by: Josef Bacik <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
Diffstat (limited to 'drivers/cdx/controller/mcdi_functions.c')
0 files changed, 0 insertions, 0 deletions