Received: by 10.213.65.68 with SMTP id h4csp484705imn; Fri, 16 Mar 2018 09:08:59 -0700 (PDT) X-Google-Smtp-Source: AG47ELubi9dw24/XvnqVyX7rnhNqzx5eq+O19SjpkrgofYcpsXkAlQUl7GGqQPechuiO1nLWPhYt X-Received: by 2002:a17:902:2006:: with SMTP id n6-v6mr2760877pla.150.1521216538971; Fri, 16 Mar 2018 09:08:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521216538; cv=none; d=google.com; s=arc-20160816; b=wiVZGnHacBtsa6yr0N3dBZN4l7OqVuZrrWyllOh9lIOPZ/aJJvklHri1nzynaMIrDl CVCS2mtoc09m4r1UKiEsXVyKKFakTAE1XXv/+r7Mis36NGw1a98otbwdIj1d5/8bGV3Z fMHdUd6ZzpBZXJnWVNrk6R+s2QMbuJxiNG5uYitjKR2miqNvTTzdPmsfr6pI1YG0sTth 5Yo0kNfCEDvoMMRG3KruzA3dPGfwJcBQyXQ+/dszMpzj2eVe6lQsvaE8XtvGxVLIJfvs GTAo2fT47W6BArlrldZsKpQE9wcUlO1TwriaSlBmgp0+QgFpxXPvhZl41z0T62iyQK+k 4eew== 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=NIBSHVsUzpf29ql4D8L0IHyRQe0Tka+Q+4NbVidNVmg=; b=irehzKuCp7FUKEBSvFV9h3SxlEH0Yllw6vYCekpvvIIdyn5MtqMBU4c3sQCxag1L6Y /ijaHt2mKRLAW9LRh8ZfBx2qpimNF3UFOf7TsmNPzhbpLcU0+EsQMDwgEcdEyZ8VM4uQ wlW7sHPPRTXE8cxmFF9HZTVglzNnJX6fOhyglI8TH/OuNZnQ9QbEM5UaWYFa3L3Cn/vJ VSfsiL8aGPbsS450fv4gVQt/JyatjLipEx3RZ+ZNG6KEspxYRJRcnt4MXr+Id2ji0Fux sGekGnPcYGMv4uF0kIJb30LuKGZJg6QFvWvL4kKZOn7NC0mGd2+ubqVBHC3z0HEYx1xy opiw== 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 x5si5186539pgb.365.2018.03.16.09.08.43; Fri, 16 Mar 2018 09:08:58 -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 S1754715AbeCPPl0 (ORCPT + 99 others); Fri, 16 Mar 2018 11:41:26 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:43960 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754556AbeCPPlW (ORCPT ); Fri, 16 Mar 2018 11:41:22 -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 14379EFF; Fri, 16 Mar 2018 15:41:21 +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.15 052/128] test_firmware: fix setting old custom fw path back on exit Date: Fri, 16 Mar 2018 16:23:13 +0100 Message-Id: <20180316152339.452678554@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180316152336.199007505@linuxfoundation.org> References: <20180316152336.199007505@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.15-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" }