From db7ad7347fde88fed611547ec31b09aa5acb165d Mon Sep 17 00:00:00 2001 From: Matt Fleming Date: Tue, 5 Mar 2013 12:46:30 +0000 Subject: [PATCH] --- yaml --- r: 360943 b: refs/heads/master c: feff5dc4f98330d8152b521acc2e18c16712e6c8 h: refs/heads/master i: 360941: f7e7e5128b24f02530877c73c4e9909f5ee9f67a 360939: e839a572b6461ddc309d3842bdb32fc04afae8b4 360935: e28c27e82238b00a2228c93ce156a9ed4758f5ad 360927: 89918e5934e6ef9f76666dcf11bc966115ad2c90 v: v3 --- [refs] | 2 +- trunk/drivers/firmware/efivars.c | 20 +++++++++++++++----- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/[refs] b/[refs] index 5c89ec12fc23..5577cdb5336a 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 123abd76edf56c02a76b46d3d673897177ef067b +refs/heads/master: feff5dc4f98330d8152b521acc2e18c16712e6c8 diff --git a/trunk/drivers/firmware/efivars.c b/trunk/drivers/firmware/efivars.c index 1b9a6e17e3dc..bea32d1ef7d5 100644 --- a/trunk/drivers/firmware/efivars.c +++ b/trunk/drivers/firmware/efivars.c @@ -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) @@ -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; @@ -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); @@ -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,