Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp500925yba; Mon, 1 Apr 2019 10:33:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqzdQeWhahQwBbou/9WEDpNxNZpxriNyE8ixwulg1rjlZ8gkAZlcuBrfSFbQizUU2JHiXgBl X-Received: by 2002:aa7:82d6:: with SMTP id f22mr2710430pfn.190.1554140000572; Mon, 01 Apr 2019 10:33:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554140000; cv=none; d=google.com; s=arc-20160816; b=b8pvW1yQe5CGFKOBb9gilRz5TSrF+Mxi76LmdoX2JjEaB29pG3wlAsGRyzPKmgogo6 to83NeP842TijQOuqqhnEifEXksePoTwHp6GkhQ3sMABIgJCu8doQfctyjtXC1UER8F1 8U9g2gWX0GmEIEw/JdA9INM5h8YMs4ZfP7vs+6EuL1yt/Cz4br7rgFfipeEAfPYs3aeu z7dZnmn0jTZhL5kr8FuW9bS+AmVMa1IFNFLRKognfEYh7VQLTikI49IN0MmGPlzeV0/D EciYKjIjCNApjtBrxj96RWsb0QvMCLSCF9E/MBC2aDYkPABQYwbt6jm8acABnqXBENLM N/mg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=HRGhSHppH2MykvfKRR4OOwC+Tx8KcTlMggpqNY4GPcE=; b=MdJ0YYoc7gKGhoCzr0MlK/MNNU0XMbz2pi9w3kU1OcDbMbqFMo1badX0SpvQgZ4zP9 8ZQyXryryUvyWkZfZ45nSPh5FMfSXaXiNOp5LW7pB4M44FQdeDXT6HpFiaIbOdLwfwiz /SEKbV2NIYH6ubBthSwxGtpoZtkKvUlsEn/ETvX70xJ8O+HxOYlgcfTJNKyXCtvj7fPL PjmcYZF9PygEtFQCjPWhgbsGWW741E08UnVKvIrxPVUm2kBDTkGMsLC1uwR1Ic433Hjs 8fWFCP5pmHyyz4/J+hGrsU6Z/2N4gHs355IrVTQnHEpISils8m8Tc5/atqQlmxQ257Fr IW6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Y7JyMGeM; 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 l8si8921584plt.347.2019.04.01.10.33.05; Mon, 01 Apr 2019 10:33:20 -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; dkim=pass header.i=@kernel.org header.s=default header.b=Y7JyMGeM; 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 S1733230AbfDARcb (ORCPT + 99 others); Mon, 1 Apr 2019 13:32:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:40648 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387494AbfDARc2 (ORCPT ); Mon, 1 Apr 2019 13:32:28 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1432D2171F; Mon, 1 Apr 2019 17:32:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1554139947; bh=jDGu7WYvtIXmX/HQD7Vaz2z74mPWWcMT+7pN35eAtbo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Y7JyMGeMcB9cRJfYlcyX7ivJWQmUW7cIPsxfnljiYg+RzV4q/pd4KD/3Nt2gsl90J WnYK7t18V0o10VJN37yd+/JXF/M0+YPWyDcPGt7HpUezzhBIHrPyKQAP+YZi0pKqLK xTNaMgPi0BSpKqZIq3qUuv4ueWdD8jc5FZk5Xlbc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chunyan Zhang , Alexander Shishkin , Sasha Levin Subject: [PATCH 4.4 061/131] stm class: Support devices with multiple instances Date: Mon, 1 Apr 2019 19:02:11 +0200 Message-Id: <20190401170057.404801989@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190401170051.645954551@linuxfoundation.org> References: <20190401170051.645954551@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. ------------------ [ Upstream commit 59be422e4ce10e3d49d4c9407a80fab8a9b7bc84 ] By convention, the name of the stm policy directory in configfs consists of the device name to which it applies and the actual policy name, separated by a dot. Now, some devices already have dots in their names that separate name of the actual device from its instance identifier. Such devices will result in two (or more, who can tell) dots in the policy directory name. Existing policy code, however, will treat the first dot as the one that separates device name from policy name, therefore failing the above case. This patch makes the last dot in the directory name be the separator, thus prohibiting dots from being used in policy names. Suggested-by: Chunyan Zhang Signed-off-by: Alexander Shishkin Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/hwtracing/stm/policy.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/hwtracing/stm/policy.c b/drivers/hwtracing/stm/policy.c index 94d3abfb737a..1db189657b2b 100644 --- a/drivers/hwtracing/stm/policy.c +++ b/drivers/hwtracing/stm/policy.c @@ -332,10 +332,11 @@ stp_policies_make(struct config_group *group, const char *name) /* * node must look like ., where - * is the name of an existing stm device and - * is an arbitrary string + * is the name of an existing stm device; may + * contain dots; + * is an arbitrary string; may not contain dots */ - p = strchr(devname, '.'); + p = strrchr(devname, '.'); if (!p) { kfree(devname); return ERR_PTR(-EINVAL); -- 2.19.1