Before adding a new parameter to a device we should check if it already exists. Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx> --- lib/parameter.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/parameter.c b/lib/parameter.c index e746467..baf7720 100644 --- a/lib/parameter.c +++ b/lib/parameter.c @@ -183,6 +183,10 @@ int dev_add_param(struct device_d *dev, const char *name, { struct param_d *param; + param = get_param_by_name(dev, name); + if (param) + return -EEXIST; + param = __dev_add_param(dev, name, set, get, flags); return param ? 0 : -EINVAL; -- 1.7.10 _______________________________________________ barebox mailing list barebox@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/barebox