summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorLucas Stach <l.stach@pengutronix.de>2014-12-08 14:42:37 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2014-12-09 09:59:10 +0100
commitc296bef5ed050b128e29e1eae6874b066be5c480 (patch)
tree3abcb2fb927e733eca4427e20d5850ec839d8a98 /fs
parenteb15ab159f6e807f7925b7bb5fff56c73a1f1b3b (diff)
downloadbarebox-c296bef5ed050b128e29e1eae6874b066be5c480.tar.gz
barebox-c296bef5ed050b128e29e1eae6874b066be5c480.tar.xz
fs: efivars: don't store attributes in file
We don't have a use-case yet where we need to manipulate the attributes of a variable and it confuses "normal" users of the variables. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'fs')
-rw-r--r--fs/efivarfs.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/fs/efivarfs.c b/fs/efivarfs.c
index a36020d2d0..f549251338 100644
--- a/fs/efivarfs.c
+++ b/fs/efivarfs.c
@@ -131,6 +131,7 @@ struct efivars_file {
unsigned long size;
efi_guid_t vendor;
s16 *name;
+ u32 attributes;
};
static int efivarfs_open(struct device_d *dev, FILE *f, const char *filename)
@@ -138,7 +139,6 @@ static int efivarfs_open(struct device_d *dev, FILE *f, const char *filename)
struct efivars_file *efile;
efi_status_t efiret;
int ret;
- uint32_t attributes;
efile = xzalloc(sizeof(*efile));
@@ -146,28 +146,27 @@ static int efivarfs_open(struct device_d *dev, FILE *f, const char *filename)
if (ret)
return -ENOENT;
- efiret = RT->get_variable(efile->name, &efile->vendor, &attributes, &efile->size, NULL);
+ efiret = RT->get_variable(efile->name, &efile->vendor,
+ &efile->attributes, &efile->size, NULL);
if (EFI_ERROR(efiret) && efiret != EFI_BUFFER_TOO_SMALL) {
ret = -efi_errno(efiret);
goto out;
}
- efile->buf = malloc(efile->size + sizeof(uint32_t));
+ efile->buf = malloc(efile->size);
if (!efile->buf) {
ret = -ENOMEM;
goto out;
}
efiret = RT->get_variable(efile->name, &efile->vendor, NULL, &efile->size,
- efile->buf + sizeof(uint32_t));
+ efile->buf);
if (EFI_ERROR(efiret)) {
ret = -efi_errno(efiret);
goto out;
}
- *(uint32_t *)efile->buf = attributes;
-
- f->size = efile->size + sizeof(uint32_t);
+ f->size = efile->size;
f->inode = efile;
return 0;