Skip to contentSkip to conversation

mdadm: modify the variable used in the set_bitmap_value()

PATCH New Wu Guanghao 1 participant 1 message Jul 22, 2025 MD RAID

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mdadm: modify the variable used in the set_bitmap_value()

The function set_bitmap_value() argument is val, and optarg is a global variable. To ensure the function's independence, modify optarg to val.

---
 mdadm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mdadm.c +1 -1
index 50d39f67..142d2873 100644
@@ -46,7 +46,7 @@ static mdadm_status_t set_bitmap_value(struct shape *s, struct context *c, char
 		return MDADM_STATUS_ERROR;
 	}
 
-	if (strcmp(optarg, STR_COMMON_NONE) == 0) {
+	if (strcmp(val, STR_COMMON_NONE) == 0) {
 		s->btype = BitmapNone;
 		return MDADM_STATUS_SUCCESS;
 	}
Signature · 1 line
2.45.2