[PATCH] md: dm-table: ensure dev_t is initialized

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Avoid returning uninitialized value in case
lookup fails.

Signed-off-by: Tomas Melin <tomas.melin@xxxxxxxxxxx>
---
 drivers/md/dm-table.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
index 8fc44c9f746a..71c59455bf3b 100644
--- a/drivers/md/dm-table.c
+++ b/drivers/md/dm-table.c
@@ -331,7 +331,7 @@ static int upgrade_mode(struct dm_dev_internal *dd, fmode_t new_mode,
  */
 dev_t dm_get_dev_t(const char *path)
 {
-	dev_t dev;
+	dev_t dev = 0;
 
 	if (lookup_bdev(path, &dev))
 		dev = name_to_dev_t(path);
-- 
2.35.1

--
dm-devel mailing list
dm-devel@xxxxxxxxxx
https://listman.redhat.com/mailman/listinfo/dm-devel




[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux