From patchwork Sat Sep 16 13:26:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Clark X-Patchwork-Id: 814504 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="WLF3Ythj"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3xvY2D138Tz9sPk for ; Sat, 16 Sep 2017 23:26:26 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id D9FEDC21E71; Sat, 16 Sep 2017 13:26:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 7040EC21C58; Sat, 16 Sep 2017 13:26:17 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 67B16C21C58; Sat, 16 Sep 2017 13:26:15 +0000 (UTC) Received: from mail-qt0-f194.google.com (mail-qt0-f194.google.com [209.85.216.194]) by lists.denx.de (Postfix) with ESMTPS id C7584C21C26 for ; Sat, 16 Sep 2017 13:26:14 +0000 (UTC) Received: by mail-qt0-f194.google.com with SMTP id f24so3106255qte.5 for ; Sat, 16 Sep 2017 06:26:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=FFMJFNvo1/ThrOm8K+DjScUICY2zfLts5fb9y/NtSHY=; b=WLF3YthjCJPvefkQjfU3XDnI90JboK1M/v7213ooAHyrHPYDjpnx88YXdZzMykXuIc cQPMXZXGTQIaTvuMhBK3nN3Zq1Pu03ODKj1Rncjur2Gi5GaDGnNa5c3xCcAJyQbbpfYP OM9V3eWQnJQUKQ8Yhj84dq9+3w353yJmpxk6E3wq9YRTNLC22dzEeeR9yYJAcgSTJGGa 1qY/mJrf8Czc28pk4yWHiDYYLXBuRxZGXc/jS42+ep0NvQsna40ctZ/+fErVl0dNUZWY 9puRM2JHMn7y0HSKG96C875uEOkG2flKtiXKrNqZ0cdXQanpiM//GKbIX5oEIanF8mzr SJrw== 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; bh=FFMJFNvo1/ThrOm8K+DjScUICY2zfLts5fb9y/NtSHY=; b=UaNUfOe0kzo7E5pAfPW7U8Dt0sq8KtUDoYEVnx3If0iNXS+1J5NgF0nMXdaP8RJLo7 D4QNyvZ1DPXjK1176DO0ulfmKPXaIRfQWJgegvNuScxhdBMAoog3f5EA+CIzUV5t+XsG Od9usDrAvtPBRIz2NtGLPRYcWfTuHmHAohinuZ00wo4OnICxqIUXjL1AV6MvBoSIyoHO zRYQBKiTLaP6DU5papEsxORyg5fjgBOLYwTEmxlWODyNcVR9fLyGfsa8vYMA7m3Puya0 g1ajojFgV7pPXX67CddjSMoOSjYtf9j+kp2ZOsaVFNMItOX5rl2oQLOcp/8zof27Yn9f iZQA== X-Gm-Message-State: AHPjjUgWErtie6lrheWX6luC64xgS1Gqmhkmye/1xfr555HDpopRDH1l FqKK6AKXPpzK/ZohAck= X-Google-Smtp-Source: AOwi7QBNqv37feVaJazJBeIl9AQB5naDyiqatH70Oa9gn7r3fxPhIWRugi0ZuCTjd4NH80eZgVeXuA== X-Received: by 10.237.63.180 with SMTP id s49mr9750311qth.43.1505568373372; Sat, 16 Sep 2017 06:26:13 -0700 (PDT) Received: from localhost ([2601:184:4780:aac0:25f8:dd96:a084:785a]) by smtp.gmail.com with ESMTPSA id f13sm2076872qtj.57.2017.09.16.06.26.12 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 16 Sep 2017 06:26:12 -0700 (PDT) From: Rob Clark To: U-Boot Mailing List Date: Sat, 16 Sep 2017 09:26:07 -0400 Message-Id: <20170916132610.7939-1-robdclark@gmail.com> X-Mailer: git-send-email 2.13.5 Cc: Heinrich Schuchardt Subject: [U-Boot] [PATCH] efi_loader: fix TEST_PROTOCOL case in OpenProtocol() X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" In the TEST_PROTOCOL case, protocol_interface might be NULL, and at any rate should not be touched. So skip efi_protocol_open() in this case. Fixes: "efi_loader: open_info in OpenProtocol" Signed-off-by: Rob Clark --- lib/efi_loader/efi_boottime.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c index 72a0c932a6..f1f0e021b9 100644 --- a/lib/efi_loader/efi_boottime.c +++ b/lib/efi_loader/efi_boottime.c @@ -1723,7 +1723,7 @@ efi_status_t EFIAPI efi_open_protocol( } r = efi_search_protocol(handle, protocol, &handler); - if (r != EFI_SUCCESS) + if (r != EFI_SUCCESS || attributes == EFI_OPEN_PROTOCOL_TEST_PROTOCOL) goto out; r = efi_protocol_open(handler, protocol_interface, agent_handle,