efivars: pstore: Do not check size when erasing variable
authorBen Hutchings <ben@decadent.org.uk>
Sat, 23 Mar 2013 03:49:53 +0000 (03:49 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 7 Jun 2014 23:02:09 +0000 (16:02 -0700)
commit1c4e6e91fec88f6a544259d5d536991e0a41f5e3
tree3eecc2102c3fbf5c9a5f0487d96a1f66317c6456
parente887bb41a177d6c6f245d80ad427f1b91fbed91e
efivars: pstore: Do not check size when erasing variable

commit 80a19debc2f2d398cfa57fae97bc99826748a602 upstream.

In 3.2, unlike mainline, efi_pstore_erase() calls efi_pstore_write()
with a size of 0, as the underlying EFI interface treats a size of 0
as meaning deletion.

This was not taken into account in my backport of commit d80a361d779a
'efi_pstore: Check remaining space with QueryVariableInfo() before
writing data'.  The size check should be omitted when erasing.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Cc: Rui Xiang <rui.xiang@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/firmware/efivars.c