[dm-devel] [PATCH] dm mpath selector: fix uninitialized value warning

Mike Christie michael.christie at oracle.com
Sun Nov 15 20:24:14 UTC 2020


This fixes an issue reproted by Colin King where the cpu variable is
used before being initialized. We can just use kzalloc) here,
because using kzalloc_node did not provide any benefit.

Reported-by: Colin Ian King <colin.king at canonical.com>
Signed-off-by: Mike Christie <michael.christie at oracle.com>
---
 drivers/md/dm-ps-io-affinity.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/md/dm-ps-io-affinity.c b/drivers/md/dm-ps-io-affinity.c
index 0da1e4d..a89f871 100644
--- a/drivers/md/dm-ps-io-affinity.c
+++ b/drivers/md/dm-ps-io-affinity.c
@@ -53,7 +53,7 @@ static int ioa_add_path(struct path_selector *ps, struct dm_path *path,
 		return -EINVAL;
 	}
 
-	pi = kzalloc_node(sizeof(*pi), GFP_KERNEL, cpu_to_node(cpu));
+	pi = kzalloc(sizeof(*pi), GFP_KERNEL);
 	if (!pi) {
 		*error = "io-affinity ps: Error allocating path context";
 		return -ENOMEM;
-- 
1.8.3.1




More information about the dm-devel mailing list