Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp3398015ybp; Sun, 6 Oct 2019 11:03:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqxinrjdACUzu9ToIT+i7x/4BQnnd2CKxU+Y+ZThuWvr6cK4osVqqSbrH2uM9pu/fL1DNMnX X-Received: by 2002:a05:6402:1212:: with SMTP id c18mr25679555edw.259.1570384998496; Sun, 06 Oct 2019 11:03:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570384998; cv=none; d=google.com; s=arc-20160816; b=fzahROkWCZRtTuzIZE2ovxePXg3oghe+vBwxIdRaRxacTfFUtZTWPVUB1WfFmUwzPe VX/WrCiCt7aa1KsNu8LJvecfyOrprWBSzyLM6aBNcP5KvLtMUUbjmUyYzaxq4Sc7pzY7 oQzwWNP0ZBCXkIFM6w0w/GwwAluJPX1cY8XTB+WI0b9FzD16AhUljudv5PDQOT4HBTwh vNu/plRp7fYE3k3zun7v6vO/iIpl2LstaRgf85ZiIbA/PvUKSrG3q6U+pgY1PIh3EVfl IEwVIKdjm+nEKN8w+fiAHux9BaajprEcOB432sEWqjzbf4aKhhRp20f2K074nNyzaStU grTA== 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=bCB9jkU1DlBVzlvf4NsEs/0uOdPczHGZJutNpd3khYc=; b=XYcIBRK7t9bqKKDja8Am0Q80dPOEem18ybfy2ar+jkwV8ZGeHUSBbb2xFlx2vq/TvA tZSvbUkZUtFgdkOfXG1FGcgTRUzUKbv8tBVJh739O7hhC+ISxVfWs28JnOr0VgKPclmu kYTBPjBkL63bw9zmt1t7jaMYy3PkXI6FfOcCRAidixWInzasPXoL7upssaUgfxfsH6ed d+810y1H4BgSYqttnUwXBn7NQ1yD6qiHMfRygFDu2sF/HxzpcLsP6+vVhYqTTe+eTAmC tFlj8tBkZJ+nTpij3dFPjO3Ajy/H0TUBFxEw8120MML72iVosUD0k88fuo7PPIcGz3ZU 8drw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="gB8/XH7T"; 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 g5si4578835ejp.418.2019.10.06.11.02.54; Sun, 06 Oct 2019 11:03:18 -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="gB8/XH7T"; 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 S1728844AbfJFR2p (ORCPT + 99 others); Sun, 6 Oct 2019 13:28:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:54384 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728829AbfJFR2n (ORCPT ); Sun, 6 Oct 2019 13:28:43 -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 9CF1F2087E; Sun, 6 Oct 2019 17:28:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570382922; bh=imc0Q0pspsvYgj/52o+N72nnGePu1STZj1a8QPV/zXc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gB8/XH7Tov3QOPnEBDlfiX43WIx0XwGyPijUv9pscUylb2eAyNDOcIBIaYJyvtMVs +TYMgF/tQNio4NHeT/GwM7SZv3GCQLSUSkFQcTZaWoKgHDrPOvMYp6wQCaByaa9eJp Podi9fEopORmqHG/U0j3e6qxdA2OjU9mdhwYZYy4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chunyan Zhang , Baolin Wang , Stephen Boyd , Sasha Levin Subject: [PATCH 4.19 020/106] clk: sprd: Dont reference clk_init_data after registration Date: Sun, 6 Oct 2019 19:20:26 +0200 Message-Id: <20191006171134.651188987@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191006171124.641144086@linuxfoundation.org> References: <20191006171124.641144086@linuxfoundation.org> User-Agent: quilt/0.66 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 From: Stephen Boyd [ Upstream commit f6c90df8e7e33c3dc33d4d7471bc42c232b0510e ] A future patch is going to change semantics of clk_register() so that clk_hw::init is guaranteed to be NULL after a clk is registered. Avoid referencing this member here so that we don't run into NULL pointer exceptions. Cc: Chunyan Zhang Cc: Baolin Wang Signed-off-by: Stephen Boyd Link: https://lkml.kernel.org/r/20190731193517.237136-8-sboyd@kernel.org Acked-by: Baolin Wang Acked-by: Chunyan Zhang Signed-off-by: Sasha Levin --- drivers/clk/sprd/common.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/clk/sprd/common.c b/drivers/clk/sprd/common.c index e038b04472061..8bdab1c3013b8 100644 --- a/drivers/clk/sprd/common.c +++ b/drivers/clk/sprd/common.c @@ -71,16 +71,17 @@ int sprd_clk_probe(struct device *dev, struct clk_hw_onecell_data *clkhw) struct clk_hw *hw; for (i = 0; i < clkhw->num; i++) { + const char *name; hw = clkhw->hws[i]; - if (!hw) continue; + name = hw->init->name; ret = devm_clk_hw_register(dev, hw); if (ret) { dev_err(dev, "Couldn't register clock %d - %s\n", - i, hw->init->name); + i, name); return ret; } } -- 2.20.1