Received: by 10.213.65.68 with SMTP id h4csp505424imn; Fri, 16 Mar 2018 09:47:56 -0700 (PDT) X-Google-Smtp-Source: AG47ELsSzFyouo0AgU3RPwmhsMdID1GKh1Z/yyiMZbiBVvTdq/lVhKubd0qLWKGz5w5eJITXIQpV X-Received: by 10.101.97.139 with SMTP id c11mr1952982pgv.435.1521218876302; Fri, 16 Mar 2018 09:47:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521218876; cv=none; d=google.com; s=arc-20160816; b=IsnNdvrb1zI+7B+JYnaov8h46JYWZLwqcnK4fp1ukg2kbYzhPumfn3/FWWxHqaG+yl ZB/F0/O0iqzn66ieriwNnejLh5TtlaAotVGIiA7GaqYmkmAaAN4fwpAB172wOWdsLRXV 63QUlE5MCLa4FDDnR9//AvCZz7KCYHwqTO924ltZxlbI8P8+KmXje9sjis25veT1Zux0 f5ONMdnCZqwuI76Sko4B9dONqjfT+FRX8LDJxH8cpShsgW283kXi/0KW7FxlRLYOvJCK ztQryB9GfX/3a8rYQ+1dNll+4lPF37grp7CrdPHqPz2DOwt4a2iyu50fzSUtk3gxfOAL vHsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=NtKdXYLKy2tVStg10wsUMGyBoJoX0R8J7h1DJDGN6N0=; b=sUbFuIiP5ZmTuxDUyxb2W2UoGzWLvHdfnmrhI2gODFX07xgTxPgMTpyOn+wRJJegxn N5T9ZHj/Pa52aoYXNrw5OENA98b6iDJBxfiSo+o5yatkBdbH0c3jx7yxN5pSXi9SnKBB 22SZTUrdhKoI3nw5ipXEHyZKNJ8orvfeC6A4YzW9t6pmCeBmYjp05h45ZIhxRK84BWka QgWCvav8CPKJTb38fZHvmTJGfRhssGzl38VXnWIrKQZfZyyQOInpREN/+/0YH2vut2ii Ibtg2oJbX5lD8Kzzs4wZ+cWnrVvyg/a4Za2vRXZitPJ0sBwbKBBMwAGQv7tzEli/RuzQ uBGA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n3si5257530pgc.12.2018.03.16.09.47.41; Fri, 16 Mar 2018 09:47:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753137AbeCPQpn (ORCPT + 99 others); Fri, 16 Mar 2018 12:45:43 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:39958 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934176AbeCPPfm (ORCPT ); Fri, 16 Mar 2018 11:35:42 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id D853A10A3; Fri, 16 Mar 2018 15:35:41 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Luis R. Rodriguez" , Sasha Levin Subject: [PATCH 4.14 044/109] test_firmware: fix setting old custom fw path back on exit Date: Fri, 16 Mar 2018 16:23:13 +0100 Message-Id: <20180316152332.364725590@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180316152329.844663293@linuxfoundation.org> References: <20180316152329.844663293@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: "Luis R. Rodriguez" [ Upstream commit 65c79230576873b312c3599479c1e42355c9f349 ] The file /sys/module/firmware_class/parameters/path can be used to set a custom firmware path. The fw_filesystem.sh script creates a temporary directory to add a test firmware file to be used during testing, in order for this to work it uses the custom path syfs file and it was supposed to reset back the file on execution exit. The script failed to do this due to a typo, it was using OLD_PATH instead of OLD_FWPATH, since its inception since v3.17. Its not as easy to just keep the old setting, it turns out that resetting an empty setting won't actually do what we want, we need to check if it was empty and set an empty space. Without this we end up having the temporary path always set after we run these tests. Fixes: 0a8adf58475 ("test: add firmware_class loader test") Signed-off-by: Luis R. Rodriguez Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- tools/testing/selftests/firmware/fw_filesystem.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) --- a/tools/testing/selftests/firmware/fw_filesystem.sh +++ b/tools/testing/selftests/firmware/fw_filesystem.sh @@ -45,7 +45,10 @@ test_finish() if [ "$HAS_FW_LOADER_USER_HELPER" = "yes" ]; then echo "$OLD_TIMEOUT" >/sys/class/firmware/timeout fi - echo -n "$OLD_PATH" >/sys/module/firmware_class/parameters/path + if [ "$OLD_FWPATH" = "" ]; then + OLD_FWPATH=" " + fi + echo -n "$OLD_FWPATH" >/sys/module/firmware_class/parameters/path rm -f "$FW" rmdir "$FWPATH" }