Skip to contentSkip to conversation

block: initialize ret in bdev_disk_changed

PATCH Applied Christoph Hellwig 4 participants 4 messages Apr 8, 2021 – Apr 12, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 block: initialize ret in bdev_disk_changed

Avoid a potentially initialized variabe in the invalidate case.

Fixes d3c4a43d9291 ("block: refactor blk_drop_partitions")
---
 fs/block_dev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/block_dev.c +1 -1
index 594a1bee9dd9ac..363015fcffdbba 100644
@@ -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);
 
Signature · 1 line
2.30.1