From patchwork Fri Mar 16 16:13:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 131931 Delivered-To: patch@linaro.org Received: by 10.46.84.17 with SMTP id i17csp939753ljb; Fri, 16 Mar 2018 09:13:37 -0700 (PDT) X-Google-Smtp-Source: AG47ELtEgy3EPf3M1CkGpN7vHQkeP4y6NuKfhwUtY+vjDddjvkCWxHHoo9Xpvj0whpyKgILOGoW8 X-Received: by 2002:a17:902:d20a:: with SMTP id t10-v6mr2729103ply.123.1521216817452; Fri, 16 Mar 2018 09:13:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521216817; cv=none; d=google.com; s=arc-20160816; b=U2hAVfjag766f8CcAMqRfGeD8qbifV78Fd9TRYtxzGX/NUfI7DlA/wo9ameUKZeZ5b 9G60T2HLTyygsMIHV98QI5bEzJNYS4/uNVDE74sSS3+m0MpJ56bQ9hXvh0hbfBJn+7kX sjeoY7C0Y08dtMw09idQT8Z8W7cfeHXr6g9yqad7HW1SQgyPWFTU5Lq3ONB60vgYzf8k 6JtAkoGr1mhy3DU/L8TC1ds5qUSSzhCdfPlxmAWbYEHak8vdWOUBUo9ThprWfz0ND4fz QU0wu8VkRJTttk5jQ5YUx70MhDaOCMGAduG3f1e19Quu23ay947R8ecoEKd72nJNJvls xc2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to:arc-authentication-results; bh=KL3S3Y0EyakQLG3zA16anRm0Ty2jGPss7TwBUFt+fEA=; b=RM/6w3aTd+dhd1EqEKxc3AhAFaQExfahmSdvNTtWmLYfxlo0Yaw2ky5atzfd1DV0bB z+YpQMyEcup8gzSvl628RqfxN8eKimxV/p7NbDHbkhSacgN5lUTKj6b0Z1jB205zn5PL fIcl9AED412VaNBj3kBPuaV66ZnOSpTKA7SFUgKChrCXxJHHT8a3R+I78jyYIUTA6sJ3 ZJZ4/g1Lga12lKeJ5O4N8vhG5MTg+dEK0bqx1HNiH95t5EvEO9KyAz9kNfFTV2IDecsT ASMfL2jc4m4aZiiIyX3hW0fhAlLZCuMm5cE5xHq9Ngg2AC5MGTOnU4gOEI7/NjzP0b08 cmRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=SRU8VCRC; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ml01.01.org (ml01.01.org. [198.145.21.10]) by mx.google.com with ESMTPS id e26si5659123pfi.171.2018.03.16.09.13.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Mar 2018 09:13:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) client-ip=198.145.21.10; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=SRU8VCRC; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 64A4521E49029; Fri, 16 Mar 2018 09:07:10 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org 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-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 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: [edk2] [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: , Cc: leif.lindholm@linaro.org, Ard Biesheuvel MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" 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(+) -- 2.15.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel 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; }