mirror of
				https://xff.cz/git/u-boot/
				synced 2025-10-31 10:26:10 +01:00 
			
		
		
		
	efi_loader: GetVariable set attributes for EFI_BUFFER_TOO_SMALL
UEFI spec 2.7 erratum A leaves it undefined if Attributes should be set if GetVariable() returns EFI_BUFFER_TOO_SMALL. UEFI spec 2.8 defines that Attributes should be set if the return value is either EFI_SUCCESS or EFI_BUFFER_TOO_SMALL. Set Attributes if the return value is EFI_BUFFER_TOO_SMALL. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
This commit is contained in:
		| @@ -202,8 +202,10 @@ efi_status_t EFIAPI efi_get_variable(u16 *variable_name, | |||||||
| 		len /= 2; | 		len /= 2; | ||||||
| 		*data_size = len; | 		*data_size = len; | ||||||
|  |  | ||||||
| 		if (in_size < len) | 		if (in_size < len) { | ||||||
| 			return EFI_EXIT(EFI_BUFFER_TOO_SMALL); | 			ret = EFI_BUFFER_TOO_SMALL; | ||||||
|  | 			goto out; | ||||||
|  | 		} | ||||||
|  |  | ||||||
| 		if (!data) | 		if (!data) | ||||||
| 			return EFI_EXIT(EFI_INVALID_PARAMETER); | 			return EFI_EXIT(EFI_INVALID_PARAMETER); | ||||||
| @@ -217,8 +219,10 @@ efi_status_t EFIAPI efi_get_variable(u16 *variable_name, | |||||||
|  |  | ||||||
| 		*data_size = len; | 		*data_size = len; | ||||||
|  |  | ||||||
| 		if (in_size < len) | 		if (in_size < len) { | ||||||
| 			return EFI_EXIT(EFI_BUFFER_TOO_SMALL); | 			ret = EFI_BUFFER_TOO_SMALL; | ||||||
|  | 			goto out; | ||||||
|  | 		} | ||||||
|  |  | ||||||
| 		if (!data) | 		if (!data) | ||||||
| 			return EFI_EXIT(EFI_INVALID_PARAMETER); | 			return EFI_EXIT(EFI_INVALID_PARAMETER); | ||||||
| @@ -232,10 +236,11 @@ efi_status_t EFIAPI efi_get_variable(u16 *variable_name, | |||||||
| 		return EFI_EXIT(EFI_DEVICE_ERROR); | 		return EFI_EXIT(EFI_DEVICE_ERROR); | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
|  | out: | ||||||
| 	if (attributes) | 	if (attributes) | ||||||
| 		*attributes = attr & EFI_VARIABLE_MASK; | 		*attributes = attr & EFI_VARIABLE_MASK; | ||||||
|  |  | ||||||
| 	return EFI_EXIT(EFI_SUCCESS); | 	return EFI_EXIT(ret); | ||||||
| } | } | ||||||
|  |  | ||||||
| static char *efi_variables_list; | static char *efi_variables_list; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user