All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dongsheng Yang <dongsheng.yang@linux.dev>
To: mpatocka@redhat.com, agk@redhat.com, snitzer@kernel.org
Cc: dm-devel@lists.linux.dev, cengku@gmail.com,
	Dongsheng Yang <dongsheng.yang@linux.dev>,
	kernel test robot <lkp@intel.com>
Subject: [PATCH] dm-pcache: fix uninitialized variable issue
Date: Fri, 15 Aug 2025 13:30:52 +0000	[thread overview]
Message-ID: <20250815133052.8138-1-dongsheng.yang@linux.dev> (raw)

The 'ret' varialbe may be returned without initialized in some branch,
this patch make sure it is initialized correctly with 0.

Fixes: 6fb8fbbaf147 ("dm-pcache: add persistent cache target in device-mapper")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202508151712.qMqD87iI-lkp@intel.com/
Signed-off-by: Dongsheng Yang <dongsheng.yang@linux.dev>
---
 drivers/md/dm-pcache/cache_dev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/md/dm-pcache/cache_dev.c b/drivers/md/dm-pcache/cache_dev.c
index 722d7e952262..a7dafe8d35f7 100644
--- a/drivers/md/dm-pcache/cache_dev.c
+++ b/drivers/md/dm-pcache/cache_dev.c
@@ -21,7 +21,7 @@ static int build_vmap(struct dax_device *dax_dev, long total_pages, void **vaddr
 	struct page **pages;
 	long i = 0, chunk;
 	unsigned long pfn;
-	int ret;
+	int ret = 0;
 
 	pages = vmalloc_array(total_pages, sizeof(struct page *));
 	if (!pages)
-- 
2.43.0


             reply	other threads:[~2025-08-15 13:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-15 13:30 Dongsheng Yang [this message]
2025-08-15 14:31 ` [PATCH] dm-pcache: fix uninitialized variable issue Mikulas Patocka
2025-08-15 14:40   ` Dongsheng Yang

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=20250815133052.8138-1-dongsheng.yang@linux.dev \
    --to=dongsheng.yang@linux.dev \
    --cc=agk@redhat.com \
    --cc=cengku@gmail.com \
    --cc=dm-devel@lists.linux.dev \
    --cc=lkp@intel.com \
    --cc=mpatocka@redhat.com \
    --cc=snitzer@kernel.org \
    /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.