Patchwork lib: fwts_uefi: modify the return value of the fwts_uefi_get_interface

login
register
mail settings
Submitter Ivan Hu
Date April 23, 2013, 4:37 a.m.
Message ID <1366691865-12418-1-git-send-email-ivan.hu@canonical.com>
Download mbox | patch
Permalink /patch/238749/
State Accepted
Headers show

Comments

Ivan Hu - April 23, 2013, 4:37 a.m.
The return value should be the UEFI_IFACE_SYSFS, when the efivars not found.

Signed-off-by: Ivan Hu <ivan.hu@canonical.com>
---
 src/lib/src/fwts_uefi.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Colin King - April 23, 2013, 7:13 a.m.
On 23/04/13 05:37, Ivan Hu wrote:
> The return value should be the UEFI_IFACE_SYSFS, when the efivars not found.
>
> Signed-off-by: Ivan Hu <ivan.hu@canonical.com>
> ---
>   src/lib/src/fwts_uefi.c |    2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/lib/src/fwts_uefi.c b/src/lib/src/fwts_uefi.c
> index 8149d23..7a9f7c6 100644
> --- a/src/lib/src/fwts_uefi.c
> +++ b/src/lib/src/fwts_uefi.c
> @@ -135,7 +135,7 @@ static int fwts_uefi_get_interface(char **path)
>
>   	if (statbuf.f_type == SYS_FS_MAGIC) {
>   		efivars_interface = UEFI_IFACE_SYSFS;
> -		return UEFI_IFACE_EFIVARS;
> +		return UEFI_IFACE_SYSFS;
>   	}
>
>   	return UEFI_IFACE_UNKNOWN;
>
Yep, stupid cut 'n' paste bug, well spotted.  Fortunately we cache the 
interface type in efivars_interface, so it gets it right on subsequent 
calls, so tools like uefidump don't fail miserably even with this bug. :-/

Acked-by: Colin Ian King <colin.king@canonical.com>
Alex Hung - April 23, 2013, 7:34 a.m.
On 04/23/2013 12:37 PM, Ivan Hu wrote:
> The return value should be the UEFI_IFACE_SYSFS, when the efivars not found.
>
> Signed-off-by: Ivan Hu <ivan.hu@canonical.com>
> ---
>   src/lib/src/fwts_uefi.c |    2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/lib/src/fwts_uefi.c b/src/lib/src/fwts_uefi.c
> index 8149d23..7a9f7c6 100644
> --- a/src/lib/src/fwts_uefi.c
> +++ b/src/lib/src/fwts_uefi.c
> @@ -135,7 +135,7 @@ static int fwts_uefi_get_interface(char **path)
>
>   	if (statbuf.f_type == SYS_FS_MAGIC) {
>   		efivars_interface = UEFI_IFACE_SYSFS;
> -		return UEFI_IFACE_EFIVARS;
> +		return UEFI_IFACE_SYSFS;
>   	}
>
>   	return UEFI_IFACE_UNKNOWN;
>
Acked-by: Alex Hung <alex.hung@canonical.com>

Patch

diff --git a/src/lib/src/fwts_uefi.c b/src/lib/src/fwts_uefi.c
index 8149d23..7a9f7c6 100644
--- a/src/lib/src/fwts_uefi.c
+++ b/src/lib/src/fwts_uefi.c
@@ -135,7 +135,7 @@  static int fwts_uefi_get_interface(char **path)
 
 	if (statbuf.f_type == SYS_FS_MAGIC) {
 		efivars_interface = UEFI_IFACE_SYSFS;
-		return UEFI_IFACE_EFIVARS;
+		return UEFI_IFACE_SYSFS;
 	}
 
 	return UEFI_IFACE_UNKNOWN;