From patchwork Sat Feb 9 21:23:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heinrich Schuchardt X-Patchwork-Id: 1039295 X-Patchwork-Delegate: agraf@suse.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=none (p=none dis=none) header.from=gmx.de Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 43xlRc2Xbnz9sMr for ; Sun, 10 Feb 2019 08:24:08 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id EF4ADC2205A; Sat, 9 Feb 2019 21:24:03 +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 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 2422CC21FE0; Sat, 9 Feb 2019 21:24:01 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 52214C21FD0; Sat, 9 Feb 2019 21:24:00 +0000 (UTC) Received: from mout.gmx.net (mout.gmx.net [212.227.17.22]) by lists.denx.de (Postfix) with ESMTPS id 06C2EC21F31 for ; Sat, 9 Feb 2019 21:24:00 +0000 (UTC) Received: from LT02.fritz.box ([84.118.159.3]) by mail.gmx.com (mrgmx101 [212.227.17.174]) with ESMTPSA (Nemesis) id 0LvyAz-1hB8761okP-017moD; Sat, 09 Feb 2019 22:23:57 +0100 From: Heinrich Schuchardt To: Alexander Graf Date: Sat, 9 Feb 2019 22:23:48 +0100 Message-Id: <20190209212348.30376-1-xypron.glpk@gmx.de> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-Provags-ID: V03:K1:FL5ojRouCLrAvHrd61SUvCBiN3Qi9xVqlrn5ekySwJHtIUsLZqh VY467ZsWz0JyL06RcxkdxOA0abfRyPsZdZDN09y1nqISwPuVWUqKj42CuzLvXOMfjZRfqWl lrfliASRtHQWcxW5Thdr05SqmVYVN1O5VcrPcO/7SinLWCqwDE4afzTFn3OvxoapwTgmTTd rxFZHX447mwTRR1BEZVaA== X-UI-Out-Filterresults: notjunk:1; V03:K0:kva0tSTvIh8=:y0BE1YnFlWoJ3R7bTVT4FG eVAT7KLRdK5kh3ZGstqD9hhp1qwUf2hoJUiS1affm3Qeq+0ykoC+Ai5vbrA4ZU6ivOcllX/+O bi1+rcSf9efzXLvfaRnArOr/EKrunCceqBWV6zHtDP+Oc1sWgI2X2dcqnXxCTn1Sza7FLGoNG PONb+/R7NRNGN6+hgdWfi0JXk8yy8oeCsVnS2Xu+4ZTYlG1Isuq6Fp6xw8+FSwnoTj3FN57Iv Kn0SIBPl+eWhzvYng4XQEJ8Tg+eYkz6cJjG764pd2f1asz6+vfupxeRTdy54+/LwpRczQtTKy SQKJXKhReCDx3ZY65C1NjEF0503o25XD6S2JT3aDF326WgDIjsO7xGIAnUGlDg3YVXDkzZJT9 Ut0tGZgJotcd/CXcZpeCrmCX9a/gUFR3iJr1iidzlEB0vorJIMB8i7v89UTzmIjGCJgylQ9yT 5X0FkdUWn+QAtpRFQgXJ43W4O0ccsv1AvSqQoRnemdGPV6RvhMk+Johc6J8AkWe7ky4l0ydec VpuF1UcODVx1caCQL//1KW762P/aGR7udE6svaVXLQ0wvWyedxTAtJbAF8+5axI3bkfLd4ACB nKpI1X2Sq9vAQ5yM1BQMA7crgkEEDEmq8vNXi/5R/DXZeDPAUb58l/O8cNq9wF3tc9LO62MCl GC65x8YyTninS8HCs0PmbD1J0dNjmAEhG7eO0e2rWp7+WKfBfUlHM8lFv7XerkzFVNsJHfy7N YFKQAe7v/89C8FiqANG2eoKktC3PklHSvVWJZKtEfT2Rt55h1SpK8SqfPp+HSRVC6qf5Ois1m +mdG71Qw7Iz8QyCwQOa0RGwPRLurl6tywzvAzAm4tPzi6PdRaHTl1q9WwErPynDHmhKyPZdbw Fu1Ejjg2Is2DNiwdC7s2pQnw7g7Ui8ZiQgXaRJ6xyBTAxTA+wiOR5YfKktWMZF Cc: u-boot@lists.denx.de, Heinrich Schuchardt Subject: [U-Boot] [PATCH 1/1] efi_loader: fix EFI_FILE_PROTOCOL.GetInfo() 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" We check the existence of files with fs_exist(). This function calls fs_close(). If we do not set the active block device again fs_opendir() fails and we do not set the flag EFI_FILE_DIRECTORY. Due to this error the `cd` command in the EFI shell fails. So let's add the missing set_blk_dev(fh) call. Signed-off-by: Heinrich Schuchardt --- lib/efi_loader/efi_file.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/efi_loader/efi_file.c b/lib/efi_loader/efi_file.c index 1341f1b456..c949275ae2 100644 --- a/lib/efi_loader/efi_file.c +++ b/lib/efi_loader/efi_file.c @@ -200,6 +200,10 @@ static struct efi_file_handle *file_open(struct file_system *fs, fs_exists(fh->path))) goto error; + /* fs_exists() calls fs_close(), so open file system again */ + if (set_blk_dev(fh)) + goto error; + /* figure out if file is a directory: */ fh->isdir = is_dir(fh); } else {