Skip to contentSkip to conversation

dm mpath selector: fix uninitialized value warning

PATCH New Mike Christie 1 participant 1 message Nov 16, 2020 Device mapper

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dm mpath selector: fix uninitialized value warning

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.

---
 drivers/md/dm-ps-io-affinity.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/md/dm-ps-io-affinity.c +1 -1
index 0da1e4d..a89f871 100644
@@ -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;
Signature · 6 lines
1.8.3.1

--
dm-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/dm-devel