Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 360943
b: refs/heads/master
c: feff5dc
h: refs/heads/master
i:
  360941: f7e7e51
  360939: e839a57
  360935: e28c27e
  360927: 89918e5
v: v3
  • Loading branch information
Matt Fleming committed Mar 6, 2013
1 parent f4fd7ba commit db7ad73
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 123abd76edf56c02a76b46d3d673897177ef067b
refs/heads/master: feff5dc4f98330d8152b521acc2e18c16712e6c8
20 changes: 15 additions & 5 deletions trunk/drivers/firmware/efivars.c
Original file line number Diff line number Diff line change
Expand Up @@ -1163,15 +1163,22 @@ static struct dentry_operations efivarfs_d_ops = {

static struct dentry *efivarfs_alloc_dentry(struct dentry *parent, char *name)
{
struct dentry *d;
struct qstr q;
int err;

q.name = name;
q.len = strlen(name);

if (efivarfs_d_hash(NULL, NULL, &q))
return NULL;
err = efivarfs_d_hash(NULL, NULL, &q);
if (err)
return ERR_PTR(err);

d = d_alloc(parent, &q);
if (d)
return d;

return d_alloc(parent, &q);
return ERR_PTR(-ENOMEM);
}

static int efivarfs_fill_super(struct super_block *sb, void *data, int silent)
Expand All @@ -1181,6 +1188,7 @@ static int efivarfs_fill_super(struct super_block *sb, void *data, int silent)
struct efivar_entry *entry, *n;
struct efivars *efivars = &__efivars;
char *name;
int err = -ENOMEM;

efivarfs_sb = sb;

Expand Down Expand Up @@ -1231,8 +1239,10 @@ static int efivarfs_fill_super(struct super_block *sb, void *data, int silent)
goto fail_name;

dentry = efivarfs_alloc_dentry(root, name);
if (!dentry)
if (IS_ERR(dentry)) {
err = PTR_ERR(dentry);
goto fail_inode;
}

/* copied by the above to local storage in the dentry. */
kfree(name);
Expand All @@ -1259,7 +1269,7 @@ static int efivarfs_fill_super(struct super_block *sb, void *data, int silent)
fail_name:
kfree(name);
fail:
return -ENOMEM;
return err;
}

static struct dentry *efivarfs_mount(struct file_system_type *fs_type,
Expand Down

0 comments on commit db7ad73

Please sign in to comment.