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 <[email protected]>
Closes:
https://lore.kernel.org/oe-kbuild-all/[email protected]/
Signed-off-by: Dongsheng Yang <[email protected]>
---
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