efi_selftest: correct block device unit test
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Sun, 22 Jul 2018 06:06:57 +0000 (08:06 +0200)
committerAlexander Graf <agraf@suse.de>
Mon, 20 Aug 2018 12:47:07 +0000 (14:47 +0200)
The UEFI specification mandates that the create flag is only used in
conjunction with both the read and the write flag.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
lib/efi_selftest/efi_selftest_block_device.c

index b82e405030246e92bce68b0e0d56728206087517..1cd13042e90d9070d17658c15e641ed1151511b9 100644 (file)
@@ -415,7 +415,7 @@ static int execute(void)
 
 #ifdef CONFIG_FAT_WRITE
        /* Write file */
-       ret = root->open(root, &file, (s16 *)L"u-boot.txt",
+       ret = root->open(root, &file, (s16 *)L"u-boot.txt", EFI_FILE_MODE_READ |
                         EFI_FILE_MODE_WRITE | EFI_FILE_MODE_CREATE, 0);
        if (ret != EFI_SUCCESS) {
                efi_st_error("Failed to open file\n");