]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[image] Avoid ending up with multiple selected images on re-registration
authorMichael Brown <mcb30@ipxe.org>
Wed, 9 Mar 2011 17:21:10 +0000 (17:21 +0000)
committerMichael Brown <mcb30@ipxe.org>
Wed, 9 Mar 2011 17:21:34 +0000 (17:21 +0000)
Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/core/image.c

index 01091f1b5db63578e2ac20c57aba56172f9536be..86c264c26634b2626e4c6bdd3347ce03af9dcc94 100644 (file)
@@ -128,6 +128,12 @@ int register_image ( struct image *image ) {
                           imgindex++ );
        }
 
+       /* Avoid ending up with multiple "selected" images on
+        * re-registration
+        */
+       if ( image_find_selected() )
+               image->flags &= ~IMAGE_SELECTED;
+
        /* Add to image list */
        image_get ( image );
        image->flags |= IMAGE_REGISTERED;