Some EFI get_variable() implementations don't set the attributes when
returning EFI_BUFFER_TOO_SMALL.

Signed-off-by: Michael Olbrich <m.olbr...@pengutronix.de>
---
 fs/efivarfs.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/fs/efivarfs.c b/fs/efivarfs.c
index 87fc771739e2..c7a282b05c63 100644
--- a/fs/efivarfs.c
+++ b/fs/efivarfs.c
@@ -216,7 +216,7 @@ static int efivarfs_open(struct device_d *dev, FILE *f, 
const char *filename)
                return -ENOENT;
 
        efiret = RT->get_variable(efile->name, &efile->vendor,
-                                 &efile->attributes, &efile->size, NULL);
+                                 NULL, &efile->size, NULL);
        if (EFI_ERROR(efiret) && efiret != EFI_BUFFER_TOO_SMALL) {
                ret = -efi_errno(efiret);
                goto out;
@@ -228,8 +228,9 @@ static int efivarfs_open(struct device_d *dev, FILE *f, 
const char *filename)
                goto out;
        }
 
-       efiret = RT->get_variable(efile->name, &efile->vendor, NULL, 
&efile->size,
-                       efile->buf);
+       efiret = RT->get_variable(efile->name, &efile->vendor,
+                                 &efile->attributes, &efile->size,
+                                 efile->buf);
        if (EFI_ERROR(efiret)) {
                ret = -efi_errno(efiret);
                goto out;
-- 
2.1.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

Reply via email to