Received: by 10.213.65.68 with SMTP id h4csp1791014imn; Mon, 19 Mar 2018 13:21:34 -0700 (PDT) X-Google-Smtp-Source: AG47ELt0F6ztbTuXinc3DGSZ4trziBN/rMi2ommc8CyhVB+P6gLqH9t/CXjwk89f5Bj2rBI417Ym X-Received: by 10.101.78.15 with SMTP id r15mr4721163pgt.283.1521490894547; Mon, 19 Mar 2018 13:21:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521490894; cv=none; d=google.com; s=arc-20160816; b=REWCdQD3hjovrlrpXGtH83BB57fsjJ16tIHd6JmXNLgMkIfCV4/aGKhp31r/ZyyDRY hnXDrqsSN1lA5EbPFsi9fuxeyqHB43KKmplcMA8maLqpsnWyHYxvA0LHpDpFHj0OVLkN ws2crK2H635wj+IHzUGwBjlJNlu8K8kQs3BJe/Fm4m/kOeciGemHEFhkwsJHEdTxJXIb rPPcmrpukFMO4S7kl+jwEIoLC9ugAjM3cSqEZLKxbzAjgB3SG2Bhf2oK5jYGZxZsldC7 KSSeJMyoYy2tPeHzxNF5lGVS6zgAtv6wi/Q2yjsDglYb6HwmbrCxf2FzzvmAWZlmHF1l D9aA== 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=Ru7zZObQZ15/sG6ocuUbvcraN8r7atq87tlAcpV80qw=; b=Ue9OJmOBAVo8GVhlu2z7Cc+X3TlNBWoHMl4ZOyNsYE3dh5ui0k6YpDE+QPC4hH9/UZ HKaw8BwIwrXQHq7cgl5BciTTxGy7tsFKFc5NBMbN+jYkNgm9X7AEOIEqTiOxrYkFcgsm bmrVIfroPeOvARo3nrTQzfd8ivREedWAatI8VdqTQ7bbczZ13+Nysu6yPW2xsK9eWYvJ SkkunVa8owQC7In6nBwxDfzXL4X/jeuQ03TwfXcqxks2iqyUFmzmMV9OHFRt8ORn6n3Z 0Q7Q3MNN/7lbOotxQzUrjuxUSAR4kPZBHp8YSuxfZMLrqB2Uhh6kxY5olzHWECwSMkCe VfIg== 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 h6-v6si4360pls.39.2018.03.19.13.21.19; Mon, 19 Mar 2018 13:21:34 -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 S971304AbeCSUSf (ORCPT + 99 others); Mon, 19 Mar 2018 16:18:35 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:44622 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S968947AbeCSSPb (ORCPT ); Mon, 19 Mar 2018 14:15:31 -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 5B1D0FF1; Mon, 19 Mar 2018 18:15:30 +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.4 085/134] test_firmware: fix setting old custom fw path back on exit Date: Mon, 19 Mar 2018 19:06:08 +0100 Message-Id: <20180319171901.557456225@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180319171849.024066323@linuxfoundation.org> References: <20180319171849.024066323@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.4-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" }