Skip to contentSkip to conversation

globalvar: call dev_set_param only once when loading nv vars

PATCH New Ahmad Fatoum 1 participant 1 message May 1

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 globalvar: call dev_set_param only once when loading nv vars

globalvar_add_simple() accepts NULL as value to mean that a global variable should be created, but dev_set_param() should not yet be called.

Instead we pass a non-NULL value, so dev_set_param() is called once when adding the variable and once more directly after via nv_set().

Fix this, so dev_set_param() is called only once.

---
 common/globalvar.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
common/globalvar.c +1 -1
index 876379b2538e..00f94d98af3d 100644
@@ -236,11 +236,11 @@ static int __nvvar_add(const char *name, const char *value)
 		if (IS_ERR(p))
 			return PTR_ERR(p);
 	}
 
 	/* Create corresponding globalvar if it doesn't exist yet */
-	ret = globalvar_add_simple(name, value);
+	ret = globalvar_add_simple(name, NULL);
 	if (ret && ret != -EEXIST)
 		return ret;
 
 	if (value)
 		return nv_set(p, name, value);
Signature · 1 line
2.47.3