diff options
author | Michael Olbrich <m.olbrich@pengutronix.de> | 2015-07-17 21:22:48 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2015-07-27 07:23:20 +0200 |
commit | 5df1c6ea9b900d95058149f91e3f0e2cd26ae9c0 (patch) | |
tree | e8d8a8c35e3e4a3b7b8fd1bde2bed14254ec226c /fs/efivarfs.c | |
parent | af53ba46c08ed7475a2910884b5b6dd1196102e8 (diff) | |
download | barebox-5df1c6ea9b900d95058149f91e3f0e2cd26ae9c0.tar.gz barebox-5df1c6ea9b900d95058149f91e3f0e2cd26ae9c0.tar.xz |
fs: efivars: read the attributes on the second get_variable()
Some EFI get_variable() implementations don't set the attributes when
returning EFI_BUFFER_TOO_SMALL.
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'fs/efivarfs.c')
-rw-r--r-- | fs/efivarfs.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/efivarfs.c b/fs/efivarfs.c index 87fc771739..c7a282b05c 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; |