summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2021-04-08 21:41:40 +0200
committerJens Axboe <axboe@kernel.dk>2021-04-12 06:44:24 -0600
commitd173b65aa75fe8d97bccf429c001633910d20bfb (patch)
tree09a5105ae736dab0b18e84af8ca860c7ef05c2dc
parent40c7fd3fdfba97a18724a0b96d132335fd419e98 (diff)
block: initialize ret in bdev_disk_changed
Avoid a potentially initialized variabe in the invalidate case. Fixes: d3c4a43d9291 ("block: refactor blk_drop_partitions") Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com> Reviewed-by: Keith Busch <kbusch@kernel.org> Link: https://lore.kernel.org/r/20210408194140.1816537-1-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--fs/block_dev.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/block_dev.c b/fs/block_dev.c
index 594a1bee9dd9..363015fcffdb 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -1236,7 +1236,7 @@ static void __blkdev_put(struct block_device *bdev, fmode_t mode, int for_part);
int bdev_disk_changed(struct block_device *bdev, bool invalidate)
{
struct gendisk *disk = bdev->bd_disk;
- int ret;
+ int ret = 0;
lockdep_assert_held(&bdev->bd_mutex);