|
@@ -183,12 +183,17 @@ static void reprioritise_settings ( struct settings *settings ) {
|
183
|
183
|
* @ret rc Return status code
|
184
|
184
|
*/
|
185
|
185
|
int register_settings ( struct settings *settings, struct settings *parent ) {
|
|
186
|
+ struct settings *old_settings;
|
186
|
187
|
|
187
|
188
|
/* NULL parent => add to settings root */
|
188
|
189
|
assert ( settings != NULL );
|
189
|
190
|
if ( parent == NULL )
|
190
|
191
|
parent = &settings_root;
|
191
|
192
|
|
|
193
|
+ /* Remove any existing settings with the same name */
|
|
194
|
+ if ( ( old_settings = find_child_settings ( parent, settings->name ) ))
|
|
195
|
+ unregister_settings ( old_settings );
|
|
196
|
+
|
192
|
197
|
/* Add to list of settings */
|
193
|
198
|
ref_get ( settings->refcnt );
|
194
|
199
|
ref_get ( parent->refcnt );
|