dm: pci: change bus number register setting compliant with Linux
[oweals/u-boot.git] / lib / efi_selftest / efi_selftest_snp.c
index 638be0147df20fc6cb62f5b1b00851dd3c612ef9..bdd6ce20da61245eaaacf79498dd03ea1a463cc3 100644 (file)
@@ -198,7 +198,7 @@ static int setup(const efi_handle_t handle,
         */
        ret = boottime->set_timer(timer, EFI_TIMER_PERIODIC, 10000000);
        if (ret != EFI_SUCCESS) {
-               efi_st_error("Failed to locate simple network protocol\n");
+               efi_st_error("Failed to set timer\n");
                return EFI_ST_FAILURE;
        }
        /*
@@ -206,6 +206,7 @@ static int setup(const efi_handle_t handle,
         */
        ret = boottime->locate_protocol(&efi_net_guid, NULL, (void **)&net);
        if (ret != EFI_SUCCESS) {
+               net = NULL;
                efi_st_error("Failed to locate simple network protocol\n");
                return EFI_ST_FAILURE;
        }
@@ -273,6 +274,12 @@ static int execute(void)
         */
        unsigned int timeout = 10;
 
+       /* Setup may have failed */
+       if (!net || !timer) {
+               efi_st_error("Cannot execute test after setup failure\n");
+               return EFI_ST_FAILURE;
+       }
+
        /*
         * Send DHCP discover message
         */