Received: by 10.213.65.68 with SMTP id h4csp1754820imn; Mon, 19 Mar 2018 12:21:14 -0700 (PDT) X-Google-Smtp-Source: AG47ELtXftu70tcZAtwn4m1SOMf2imOSDIc//fzysiNtscKe4nJO03ebtq3hd0abzvOWYBGmcHV/ X-Received: by 10.99.140.87 with SMTP id q23mr9949115pgn.258.1521487274021; Mon, 19 Mar 2018 12:21:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521487273; cv=none; d=google.com; s=arc-20160816; b=wqdFG+a5pWOcqKq97p1d1d+n1/OFB3frOAUHB0cKpwxKfNAhgCVrCN1vfZbkdwBa0v +IenNHN+7v9uwJJfl4O2S8DmJm2dMGMWwrPBMNB9ldv12UK+NJkyAayEXbE6dMPpJ1us hlK3fRTEN28eT25Q2l5gPT00/k3dqiJrOUC5ZUkzq7sKs4s116973CrrRr8y2A67mYOy IhiyB1ZJIPvkendsDf94ollHh1mvYPcWvYnGXjynaBfBCxCw6ps+ilT4wlj8xR8k4sxs GEthtWX3R10kLgv4CfiXCoxKcsY8AioXZctWEmIw3ZyULyvWZTaXsM7kwea1xzWXxpRc kw+w== 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=1XeetnkCtlghs0lRgmyAZ/2uoVQBwZLW0nn+bn4Zt0Q=; b=s34CzgwhGDc+0rVtjbryWbbPdhq1CtO9VaEXHjJlfURmDlMMRfqW2Ia4JMVVQFbENW 4QZAibnphFn+h/DjS2f2+GnbSGjB3JXvEbB+p8mQiPFt6UlD9iKf1Ih85pPt/F2/tFmt guDwgpmq3fLTZvjvTQ520gbcU/HyfbdZoFHTPJFlWWdosHA1Hd00OXoio1ErlrZloV43 4ItgIrAwafIv02rgADElppiWO5Srb78MLY947LHsy1Sw4RMzz5o2LeAk7plYPmUYYK5k 799iDnIuMVbosWeIDt4KUJmjlUwqh065dlXyJO6GpEZ+My1OVFVihLEcyEJQjyOUUBq3 CUCQ== 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 5-v6si517593plt.371.2018.03.19.12.21.00; Mon, 19 Mar 2018 12:21:13 -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 S969806AbeCSSZz (ORCPT + 99 others); Mon, 19 Mar 2018 14:25:55 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:50520 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S969765AbeCSSZn (ORCPT ); Mon, 19 Mar 2018 14:25:43 -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 2E42FF91; Mon, 19 Mar 2018 18:25: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.9 172/241] test_firmware: fix setting old custom fw path back on exit Date: Mon, 19 Mar 2018 19:07:17 +0100 Message-Id: <20180319180758.280064406@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180319180751.172155436@linuxfoundation.org> References: <20180319180751.172155436@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.9-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 @@ -28,7 +28,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" }