From patchwork Wed Mar 27 04:40:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 1066452 X-Patchwork-Delegate: xypron.glpk@gmx.de 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; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="IksIaTip"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 44Tb153vHXz9sPR for ; Wed, 27 Mar 2019 15:41:13 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 1F831C21E3E; Wed, 27 Mar 2019 04:39:51 +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=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 C9C84C21E62; Wed, 27 Mar 2019 04:39:35 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id AEFC5C21E5B; Wed, 27 Mar 2019 04:39:26 +0000 (UTC) Received: from mail-yw1-f66.google.com (mail-yw1-f66.google.com [209.85.161.66]) by lists.denx.de (Postfix) with ESMTPS id C6CB1C21E35 for ; Wed, 27 Mar 2019 04:39:24 +0000 (UTC) Received: by mail-yw1-f66.google.com with SMTP id w66so11583749ywd.4 for ; Tue, 26 Mar 2019 21:39:24 -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 :mime-version:content-transfer-encoding; bh=wto0VLwbm2BnvYT7sDe71i/FYULGakGD+10bQqBLM4c=; b=IksIaTipiWK5zzYdVbGGWQWEw9i+xg3bEWM6Q8aJnNbkQsQzjQKl6gfh0FdI4FKEqt LaPc5cxcFQfGyw/8djjh8BWiZ7qqFSnWfW7Phf2BsQZaV79JrTPQjooYtlQk5zXuAJw8 uduOAqKafLtVzi9r4Qf1Kg+oK+zW5UEvNbHCusxpjwN9Bl8hsQJSRnkkSTWCX/8D24q3 B2RzK+vL3rL5XR/2C5mTgdgpy8Z/dzUrPDV1yH5OgpT4bITME1kfj1WI9bu9c5wuRRT2 L1pIXrYjiekbGIVlR4Np/eIuFo9HUneXBND7gitHKUbO5VfFqcMV45vIJ/Qw/mE+0Br/ 8MKQ== 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:mime-version:content-transfer-encoding; bh=wto0VLwbm2BnvYT7sDe71i/FYULGakGD+10bQqBLM4c=; b=hJtPfw+2j3kegF2iBdMmBmqE0HkTzQN7Y01/cEtNCDDlLV0siTg0YRg35mB/CoVUFC N7N9CqxpeBr1iERPwEwEQGwkHrTCfxEeYYpSDDPfUkurUAYyzdA31ccHvSVWDUOkW8Wd mjtQSeU9W1vtBEs+d8+MuzaR4tBl8KLB6w9SOVJo06q905u868YkZPNEH2p7ibZ32VG1 nYlAGrH97XRPSDxikZJ9hGzelsI4MuTtVMsS5PkmUKzdCW68jeB610D4X0bSiyZbNmrh jeF1qbqn6sIJaMAl59354jnIKpPZeludadh2aMPd3DaKnvflztgu5Hh399roKTaDJGNq sOHg== X-Gm-Message-State: APjAAAV8wkeoJ72JZuz0a5AEHGOipNDpPXEkow4z0xn4K1+khO6qkXwu 6ZHXX6Q/dT5fcZW8fVRxFSVRoQ== X-Google-Smtp-Source: APXvYqyyBDkbRofOkH3LKOt0pkH5phP3C0QmwjH6hhCge8jYBJInEBz1ubgK3ioemaGnqaVhWDBd1Q== X-Received: by 2002:a25:1488:: with SMTP id 130mr5226966ybu.468.1553661563810; Tue, 26 Mar 2019 21:39:23 -0700 (PDT) Received: from linaro.org ([121.95.100.191]) by smtp.googlemail.com with ESMTPSA id g1sm7152170ywf.0.2019.03.26.21.39.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Mar 2019 21:39:23 -0700 (PDT) From: AKASHI Takahiro To: xypron.glpk@gmx.de, agraf@csgraf.de Date: Wed, 27 Mar 2019 13:40:34 +0900 Message-Id: <20190327044042.13707-4-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190327044042.13707-1-takahiro.akashi@linaro.org> References: <20190327044042.13707-1-takahiro.akashi@linaro.org> MIME-Version: 1.0 Cc: u-boot@lists.denx.de Subject: [U-Boot] [RFC v2 03/11] efi_loader: device_path: handle special case of loading 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: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" This is a preparatory patch. efi_dp_split_file_path() is used to create device_path and file_path from file_path for efi_setup_loaded_image(). In a special case, however, of HARDWARE_DEVICE/MEMORY, it doesn't work expectedly since this path doesn't contain any FILE_PATH sub-type. This patch makes a workaround. Signed-off-by: AKASHI Takahiro --- lib/efi_loader/efi_device_path.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/efi_loader/efi_device_path.c b/lib/efi_loader/efi_device_path.c index 53b40c8c3c2d..e283fad767ed 100644 --- a/lib/efi_loader/efi_device_path.c +++ b/lib/efi_loader/efi_device_path.c @@ -933,6 +933,14 @@ efi_status_t efi_dp_split_file_path(struct efi_device_path *full_path, dp = efi_dp_dup(full_path); if (!dp) return EFI_OUT_OF_RESOURCES; + + if (EFI_DP_TYPE(dp, HARDWARE_DEVICE, MEMORY)) { + /* no FILE_PATH */ + *device_path = dp; + + return EFI_SUCCESS; + } + p = dp; while (!EFI_DP_TYPE(p, MEDIA_DEVICE, FILE_PATH)) { p = efi_dp_next(p);