From patchwork Mon Jul 3 02:47:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahisa Kojima X-Patchwork-Id: 698627 Delivered-To: patch@linaro.org Received: by 2002:adf:fcc5:0:0:0:0:0 with SMTP id f5csp1537086wrs; Sun, 2 Jul 2023 19:48:00 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5QjDbRjlcOXETVfUBuOSTMqQAfiy+ZkRitGaxzgGFOGIIktIGIvFG+9d/67NL+mMr4MbnK X-Received: by 2002:a7b:c8c2:0:b0:3fa:96e3:9227 with SMTP id f2-20020a7bc8c2000000b003fa96e39227mr6143287wml.31.1688352480699; Sun, 02 Jul 2023 19:48:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688352480; cv=none; d=google.com; s=arc-20160816; b=fRQURzZzNmYdE917rznvdY+Oy+FtGJvONfecVLUl877dE5M4nmSRO5OahOyOfmO5jd U88Rjk+7q5gU0Haj0umCeNNT+pwsg8rgEsFftZTnmxgZL24tHP6P6nDh13Fkm5qsGTFH d6SNGr/TjQgbhgazZX7IMjgnKGGMRxm+knuiLzdvEdB0FrvozrjiUmRaiq+VfMS8lH0R 1QHLWI0xu39rtPzMGtR88ombXPNwJcOUodiA7pBw+kXQ2LsTsacFhbjcfh3q7/LqFUqQ m5S6A3ZsHUtl83pnZMYcFNOCNpJAvnIc4DZV9dz0xNFbN2EABzfU+7P9TE6MYAn4c0Xp js4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=QnyMkgLmGsCgDWVcUJkDJnU7TUysmNkullCHt15Ix8U=; fh=YtnCJplQ1DA0Rz8c1dg8CfrVxTgSI4BIXB9JUZxV1zk=; b=aIzKbHsWs5lc7YeMGYWlkcnvC7ci2yimpADgfyDIMmwi0CLDZ1tiay7BCC6VvabhyP Oeiyt93gWGo9XL91h43qorERHbGXqSybOUywVD+moQOFm1LPI8doLS+YnUJyzrLWtELz 6LzEr3qCfXqLQxme8KTAtTSK/cQucdS6j0vp+8tbNyzk3h6CSCN1VXaByyA0OTy9IFXT Zs8kzriOp3wUGEDaseQ7gi94a0QSg/Rd7aDNiBobCYcx/bEYAJMo2opaDBolNRRL8MQf i2vsE40OkUVFDpLrj5+ZbcqGfq9yYsqNfn1V8GvzfE9qaOVK9Qy2LC3BZ/A7/Npdvgey fCYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nvGWrMBB; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id az20-20020a05600c601400b003fba23de852si8860501wmb.138.2023.07.02.19.48.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Jul 2023 19:48:00 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nvGWrMBB; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 21A0186366; Mon, 3 Jul 2023 04:47:59 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="nvGWrMBB"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1C2DE86373; Mon, 3 Jul 2023 04:47:57 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id C321186346 for ; Mon, 3 Jul 2023 04:47:54 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=masahisa.kojima@linaro.org Received: by mail-pj1-x1034.google.com with SMTP id 98e67ed59e1d1-2632336f75fso2853311a91.3 for ; Sun, 02 Jul 2023 19:47:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1688352473; x=1690944473; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=QnyMkgLmGsCgDWVcUJkDJnU7TUysmNkullCHt15Ix8U=; b=nvGWrMBBY0QMJuqupsS2CK+E+lcCS9yI+koLxiNjWuoD+J+/vrnQqaj/1VIIDG+EqV tiW5osA8vtVJ+wSRl2mmE6uuwtBhSbjlGcmNpKoheV6/8xqCy5DlkwN6p5KFeL6DcUFT SBvs56iWmX88HhyIhjKMs5zNIsxWImixwoKBR5v3KcJbN1vp9wGfDWJPUGwqnVthYeh3 l6LvnbGloqLvSW5cKM2jT6kdmgMVPXtpQn6hbHhcg0/B1hW9UEjYQp4p+g2OWXLbbb34 GpFKQ/jmJgzhq8J0Bh1tCILV5ISc/89RmrWCG652rJ79LKlnyA25GpNi/8FfNcPRlU9p EbZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688352473; x=1690944473; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=QnyMkgLmGsCgDWVcUJkDJnU7TUysmNkullCHt15Ix8U=; b=RZgUcmzTEPqj6PaTHOR4GMjGe5CoT9kSMhtiUTEEO7kCJJ1ShmGiuVGA7aUm/n89Px rKrMGq+gSrplLRBBq2KqhRBUrapUnx2HlQJPIAtEGRv0GsKPwh0SUqgZyFVI2ehs0BpO jAMqJiCZhlCxpv/5gLdEYqgLGyMMzyitYWtteIp8+K8VZqJN4kb5TWVI7WTEDZRaIOXJ 5WgYjDIG/nJlz13ywK5PmBE2XBtwVpIoy4dCj/5Ne/cJ9oB4kBGkJfINmet87kZpL+S5 N38eRgfAd9UcS8W+Rr5OTNgjUFqN02Wh6nPTOa2uNPVrIKtAcP1dFthC9YZ7V4v99n0F 49jg== X-Gm-Message-State: ABy/qLad9fcmtPocHCjH4O4dGPa+a8HbJnw0BH9E4dSCHDOrUYBRjr+x LqrCiObZShVw0bFvSJRGg8GGCQkl45sLN2LG0d4= X-Received: by 2002:a17:90b:4f85:b0:262:f093:e26d with SMTP id qe5-20020a17090b4f8500b00262f093e26dmr10139175pjb.46.1688352472765; Sun, 02 Jul 2023 19:47:52 -0700 (PDT) Received: from localhost ([164.70.16.189]) by smtp.gmail.com with ESMTPSA id y124-20020a636482000000b0053423447a12sm13968624pgb.73.2023.07.02.19.47.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Jul 2023 19:47:52 -0700 (PDT) From: Masahisa Kojima To: u-boot@lists.denx.de Cc: Heinrich Schuchardt , Ilias Apalodimas , Masahisa Kojima Subject: [PATCH] efi_driver: fix duplicate efiblk#0 issue Date: Mon, 3 Jul 2023 11:47:18 +0900 Message-Id: <20230703024718.309452-1-masahisa.kojima@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean The devnum value of the blk_desc structure starts from 0, current efi_bl_create_block_device() function creates two "efiblk#0" devices for the cases that blk_find_max_devnum() returns -ENODEV and blk_find_max_devnum() returns 0(one device found in this case). The devnum value for the "efiblk" name needs to be incremented. Signed-off-by: Masahisa Kojima --- lib/efi_driver/efi_block_device.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/efi_driver/efi_block_device.c b/lib/efi_driver/efi_block_device.c index add00eeebb..e37bfe6e80 100644 --- a/lib/efi_driver/efi_block_device.c +++ b/lib/efi_driver/efi_block_device.c @@ -129,6 +129,8 @@ efi_bl_create_block_device(efi_handle_t handle, void *interface) devnum = 0; else if (devnum < 0) return EFI_OUT_OF_RESOURCES; + else + devnum++; /* device found, note that devnum starts from 0 */ name = calloc(1, 18); /* strlen("efiblk#2147483648") + 1 */ if (!name)