dm-pcache: fix uninitialized variable issue
Subsystems (2)
Dongsheng Yang
maintainerPATCH 1/1 dm-pcache: fix uninitialized variable issue
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]>
Signed-off-by Dongsheng Yang <[email protected]>
--- drivers/md/dm-pcache/cache_dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/md/dm-pcache/cache_dev.c +1 -1
@@ -21,7 +21,7 @@ static int build_vmap(struct dax_device *dax_dev, long total_pages, void **vaddrstruct page **pages;long i =0 , chunk;unsigned long pfn; -int ret; +int ret =0 ; pages =vmalloc_array (total_pages,sizeof (struct page *));if (!pages)
Signature · 1 line
2.43.0
Mikulas Patocka
maintainerQuoted 2 lines · Dongsheng Yang
The 'ret' varialbe may be returned without initialized in some branch, this patch make sure it is initialized correctly with 0.
Hi
I've already fixed it (and I folded the fix into the existing commit).
Mikulas
Quoted 24 lines
Fixes 6fb8fbbaf147 ("dm-pcache: add persistent cache target in device-mapper")Reported-by kernel test robot <[email protected]>Signed-off-by Dongsheng Yang <[email protected]>--- drivers/md/dm-pcache/cache_dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/md/dm-pcache/cache_dev.c +1
-1@@ -21,7 +21,7 @@ static int build_vmap(struct dax_device *dax_dev, long total_pages, void **vaddrstruct page **pages;long i =0 , chunk;unsigned long pfn; -int ret; +int ret =0 ; pages =vmalloc_array (total_pages,sizeof (struct page *));if (!pages)Signature · 1 line
2.43.0
Dongsheng Yang
maintainerQuoted 8 lines · Mikulas Patocka
Quoted 2 lines · Dongsheng Yang
The 'ret' varialbe may be returned without initialized in some branch, this patch make sure it is initialized correctly with 0.
Hi
I've already fixed it (and I folded the fix into the existing commit).
Okey, thanx
Dongsheng
Quoted 27 lines
Mikulas
Quoted 24 lines
Fixes 6fb8fbbaf147 ("dm-pcache: add persistent cache target in device-mapper")Reported-by kernel test robot <[email protected]>Signed-off-by Dongsheng Yang <[email protected]>--- drivers/md/dm-pcache/cache_dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/md/dm-pcache/cache_dev.c +1
-1@@ -21,7 +21,7 @@ static int build_vmap(struct dax_device *dax_dev, long total_pages, void **vaddrstruct page **pages;long i =0 , chunk;unsigned long pfn; -int ret; +int ret =0 ; pages =vmalloc_array (total_pages,sizeof (struct page *));if (!pages)Signature · 1 line
2.43.0