linux-efi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] efivars: Check max_size only if it is non-zero.
@ 2013-04-04 13:01 Richard Weinberger
  2013-04-04 13:01 ` [PATCH 2/2] efivars: Implement no_storage_paranoia parameter Richard Weinberger
       [not found] ` <1365080500-13677-1-git-send-email-richard-/L3Ra7n9ekc@public.gmane.org>
  0 siblings, 2 replies; 5+ messages in thread
From: Richard Weinberger @ 2013-04-04 13:01 UTC (permalink / raw)
  To: matt.fleming
  Cc: cbouatmailru, ccross, keescook, tony.luck, linux-efi,
	linux-kernel, matthew.garrett, Richard Weinberger

Some (broken?) EFI implementations return always a MaximumVariableSize of 0,
check against max_size only if it is non-zero.

Signed-off-by: Richard Weinberger <richard@nod.at>
---
 drivers/firmware/efivars.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c
index 7acafb8..8e87f8d 100644
--- a/drivers/firmware/efivars.c
+++ b/drivers/firmware/efivars.c
@@ -449,7 +449,8 @@ check_var_size_locked(struct efivars *efivars, u32 attributes,
 	if (status != EFI_SUCCESS)
 		return status;
 
-	if (!storage_size || size > remaining_size || size > max_size ||
+	if (!storage_size || size > remaining_size ||
+	    (max_size && size > max_size) ||
 	    (remaining_size - size) < (storage_size / 2))
 		return EFI_OUT_OF_RESOURCES;
 
-- 
1.8.1.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-04-05 14:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-04 13:01 [PATCH 1/2] efivars: Check max_size only if it is non-zero Richard Weinberger
2013-04-04 13:01 ` [PATCH 2/2] efivars: Implement no_storage_paranoia parameter Richard Weinberger
     [not found] ` <1365080500-13677-1-git-send-email-richard-/L3Ra7n9ekc@public.gmane.org>
2013-04-04 16:00   ` [PATCH 1/2] efivars: Check max_size only if it is non-zero Luck, Tony
2013-04-04 16:12     ` Richard Weinberger
     [not found]       ` <515DA677.8050805-/L3Ra7n9ekc@public.gmane.org>
2013-04-05 14:03         ` Matt Fleming

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).