Received: by 10.223.185.116 with SMTP id b49csp1064477wrg; Fri, 23 Feb 2018 11:15:57 -0800 (PST) X-Google-Smtp-Source: AH8x2266LFjSvI5q1ZXFV6dgcgjtUzTphdk0wJD5yk5DVAoNx3yFVkfmw5FQB9zbBBLoVO8OHKX9 X-Received: by 2002:a17:902:be02:: with SMTP id r2-v6mr2673664pls.234.1519413356987; Fri, 23 Feb 2018 11:15:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519413356; cv=none; d=google.com; s=arc-20160816; b=nHrH+JMIfeE5RJ4Tx+qNwD4f20yq9LIAix/HOLywUJOC3psjz31TXv4tT73lMRXyjA pCFaR2SptKM/V2hS3cUsvp8jKoifca12XUIPXiLthUrzFF7naE6s0JkiP3Jyc0FqWs1H +OrAnfdFCtUmgdiZ1h5AOYg83+Kbe/NKWFJVVpP6HLixM2ppHXfyln/tvSE5yQap2jri GI9sAx/ofkEcooSZQ49LIe6KK7rKKvIa1LdKdFtAogmRu6ltn1c7zPfQd3oX+ZdZkmQ8 Ot4MtO855tonyEWM2VN1XWpcoECzJtKAKd/Euxz6xFC8cxCq6I+3V92zTfsq0LhdFVcR Qx9Q== 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=Sgzdm76EbC8I/29jncHFLOu/xzQh+W97BRwoTrP3myo=; b=VpZ39OVr523mBLQ450jegheQOu7BFhoH8cqMSC1LVcpx5DUsFvthqLP8vgHqw4dbzJ su9Qg4iCC/7BRTgApQzL7CVdeKj0DSj7oJqLoNRZOBq5ehSzMUe7Yp8zEapvIQ9VkRjh mg5YzKnewqbrZOwu4CtwDvZkJ8Wg9j7ze+JyS3z8sjytEF9dNRhmxSiEH88yF5stkAbB eoGQabnQ+lp0oEhVUYY1brBgFjyQqEPcWryA/nYTXjVs5ob9YH3zcgdDEP0I+BJFXNrq QytcKWd2/BUXSAJEiEQ/8YyGJT8234hg5QJ6OuBVDPRDLIZ57pDVuIKnlgt32DiG1GM1 1qxg== 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 h12-v6si2163064pls.265.2018.02.23.11.15.42; Fri, 23 Feb 2018 11:15:56 -0800 (PST) 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 S935538AbeBWSzd (ORCPT + 99 others); Fri, 23 Feb 2018 13:55:33 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:48246 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964838AbeBWSza (ORCPT ); Fri, 23 Feb 2018 13:55:30 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 646591257; Fri, 23 Feb 2018 18:55:29 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Cai Li , Chunyan Zhang , Stephen Boyd , Sasha Levin Subject: [PATCH 4.14 135/159] clk: fix a panic error caused by accessing NULL pointer Date: Fri, 23 Feb 2018 19:27:23 +0100 Message-Id: <20180223170759.422992720@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180223170743.086611315@linuxfoundation.org> References: <20180223170743.086611315@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: Cai Li [ Upstream commit 975b820b6836b6b6c42fb84cd2e772e2b41bca67 ] In some cases the clock parent would be set NULL when doing re-parent, it will cause a NULL pointer accessing if clk_set trace event is enabled. This patch sets the parent as "none" if the input parameter is NULL. Fixes: dfc202ead312 (clk: Add tracepoints for hardware operations) Signed-off-by: Cai Li Signed-off-by: Chunyan Zhang Signed-off-by: Stephen Boyd Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- include/trace/events/clk.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/include/trace/events/clk.h +++ b/include/trace/events/clk.h @@ -134,12 +134,12 @@ DECLARE_EVENT_CLASS(clk_parent, TP_STRUCT__entry( __string( name, core->name ) - __string( pname, parent->name ) + __string( pname, parent ? parent->name : "none" ) ), TP_fast_assign( __assign_str(name, core->name); - __assign_str(pname, parent->name); + __assign_str(pname, parent ? parent->name : "none"); ), TP_printk("%s %s", __get_str(name), __get_str(pname))