From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c0c::244; helo=mail-wr0-x244.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wr0-x244.google.com (mail-wr0-x244.google.com [IPv6:2a00:1450:400c:c0c::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id E421E20954BB2 for ; Fri, 16 Mar 2018 09:07:07 -0700 (PDT) Received: by mail-wr0-x244.google.com with SMTP id h2so12204036wre.12 for ; Fri, 16 Mar 2018 09:13:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=WXaYHjYEe6/nlwT9JWXFcLEkXj9565ICXBYMJ7hq+dE=; b=SRU8VCRCT7liC+7sam6LpvSi6+j7BP2YHXzKsxUMQfqrVVLfN0CIyz3NLM6dh16BLD Uz/51iA/4h+YAbPqMh2HAaAm6MR/AHVVsypdT1cqRMTrZXD3dsDgb902jm8s712NmvVw t37GOPX8LHZRDoKLofIL0bwUGl6YvJVzYudxo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=WXaYHjYEe6/nlwT9JWXFcLEkXj9565ICXBYMJ7hq+dE=; b=rYEjS0ZWhxfcp2GkVIEkKac2Qi5n0+cRJ2C3zmi36/zU9Gi3lQyqAufwEtubWoV91F pVjF5fF2vPFxMhFn+rFrd7Ile8+tJ/DTvX+p8znMdMO2/ei5FhifFyqWE8USiUeZIUsz Rjq30EM+LijloIY+QUJrQeYvT7f7vcOz1bbXMGVURfKMgj+TRMJRRRZANna1ez2V2jBB tqxCCjtiHf/us6+/83XYpMB2lFsyHceMOgaQMqZ6ilncZIRDOyO7P/lKZOIOWc8NpQjS L7xLimfeP1F5zoO8jqCMtVtNmE1Hw5XeZ/chNqJEZIM1H0/Fg4fRZ/V11gSlQm+rQ0jt +6lw== X-Gm-Message-State: AElRT7GLVgIFJXG/nBWDkICMkiurm4+eGESzdBNmIT8z9oRtdVNJFb8y VB+cKJZTmwdCWhSFdgWhWeO4oCg9Jk0= X-Google-Smtp-Source: AG47ELuj/TWLrxAMGewtN8kxYPfQXgqbP6ftGO8fWzY47A6aTg0trreWyoFHK0Si/7FIqGWJneQ/Sg== X-Received: by 10.223.174.247 with SMTP id y110mr2168505wrc.68.1521216811644; Fri, 16 Mar 2018 09:13:31 -0700 (PDT) Received: from localhost.localdomain ([105.142.191.63]) by smtp.gmail.com with ESMTPSA id n8sm7876242wrf.12.2018.03.16.09.13.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Mar 2018 09:13:30 -0700 (PDT) From: Ard Biesheuvel To: edk2-devel@lists.01.org Cc: leif.lindholm@linaro.org, Ard Biesheuvel Date: Fri, 16 Mar 2018 16:13:17 +0000 Message-Id: <20180316161322.6756-2-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180316161322.6756-1-ard.biesheuvel@linaro.org> References: <20180316161322.6756-1-ard.biesheuvel@linaro.org> Subject: [RFC PATCH edk2-platforms 1/6] Silicon/SynQuacerPlatformFlashAccessLib: fix return value on no FVB found X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Mar 2018 16:07:08 -0000 If no suitable FVB protocol implementation is found to apply the capsule update, and the last one we disregarded was ruled out because it has the read-only attribute, we will exit the function returning EFI_SUCCESS without assigning a value to *OutFvb, resulting in a crash when it subsequently gets dereferenced. So set the correct value for Status for that case. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel --- Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAccessLib/SynQuacerPlatformFlashAccessLib.c | 1 + 1 file changed, 1 insertion(+) diff --git a/Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAccessLib/SynQuacerPlatformFlashAccessLib.c b/Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAccessLib/SynQuacerPlatformFlashAccessLib.c index fbb8f1f9e48c..1af4abc16aa5 100644 --- a/Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAccessLib/SynQuacerPlatformFlashAccessLib.c +++ b/Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAccessLib/SynQuacerPlatformFlashAccessLib.c @@ -99,6 +99,7 @@ GetFvbByAddress ( DEBUG ((DEBUG_INFO, "%a: ignoring read-only FVB protocol implementation\n", __FUNCTION__)); + Status = EFI_NOT_FOUND; continue; } -- 2.15.1