efivarfs: return accurate error code in efivarfs_fill_super()
authorMatt Fleming <matt.fleming@intel.com>
Tue, 5 Mar 2013 12:46:30 +0000 (12:46 +0000)
committerMatt Fleming <matt.fleming@intel.com>
Wed, 6 Mar 2013 14:46:30 +0000 (14:46 +0000)
commitfeff5dc4f98330d8152b521acc2e18c16712e6c8
tree9d4180eb62dcb4f1d111acc3c1e000e82c80b1f6
parent123abd76edf56c02a76b46d3d673897177ef067b
efivarfs: return accurate error code in efivarfs_fill_super()

Joseph was hitting a failure case when mounting efivarfs which
resulted in an incorrect error message,

  $ sudo mount -v /sys/firmware/efi/efivars mount: Cannot allocate memory

triggered when efivarfs_valid_name() returned -EINVAL.

Make sure we pass accurate return values up the stack if
efivarfs_fill_super() fails to build inodes for EFI variables.

Reported-by: Joseph Yasi <joe.yasi@gmail.com>
Reported-by: Lingzhu Xiang <lxiang@redhat.com>
Cc: Josh Boyer <jwboyer@redhat.com>
Cc: Jeremy Kerr <jk@ozlabs.org>
Cc: Matthew Garrett <mjg59@srcf.ucam.org>
Cc: <stable@vger.kernel.org> # v3.8
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
drivers/firmware/efivars.c