All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: axboe@kernel.dk
Cc: linux-block@vger.kernel.org, kernel test robot <lkp@intel.com>
Subject: [PATCH] block: initialize ret in bdev_disk_changed
Date: Thu,  8 Apr 2021 21:41:40 +0200	[thread overview]
Message-ID: <20210408194140.1816537-1-hch@lst.de> (raw)

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>
---
 fs/block_dev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/block_dev.c b/fs/block_dev.c
index 594a1bee9dd9ac..363015fcffdbba 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);
 
-- 
2.30.1


             reply	other threads:[~2021-04-08 19:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-08 19:41 Christoph Hellwig [this message]
2021-04-08 21:17 ` [PATCH] block: initialize ret in bdev_disk_changed Chaitanya Kulkarni
2021-04-08 21:41 ` Keith Busch
2021-04-12 12:44 ` Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210408194140.1816537-1-hch@lst.de \
    --to=hch@lst.de \
    --cc=axboe@kernel.dk \
    --cc=linux-block@vger.kernel.org \
    --cc=lkp@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.