X-Git-Url: http://git.etherboot.org/people/mcb30/gpxe.git/blobdiff_plain/b111bdfb000b22a41961ae9d3d2920a9c43d84f8..d2b0081740de9e31fb28f7c6761bbf78835c07d7:/src/core/settings.c?ds=sidebyside diff --git a/src/core/settings.c b/src/core/settings.c index 09033bd9..2c886fdf 100644 --- a/src/core/settings.c +++ b/src/core/settings.c @@ -183,12 +183,17 @@ static void reprioritise_settings ( struct settings *settings ) { * @ret rc Return status code */ int register_settings ( struct settings *settings, struct settings *parent ) { + struct settings *old_settings; /* NULL parent => add to settings root */ assert ( settings != NULL ); if ( parent == NULL ) parent = &settings_root; + /* Remove any existing settings with the same name */ + if ( ( old_settings = find_child_settings ( parent, settings->name ) )) + unregister_settings ( old_settings ); + /* Add to list of settings */ ref_get ( settings->refcnt ); ref_get ( parent->refcnt );