Received: by 10.213.65.68 with SMTP id h4csp2118458imn; Sun, 8 Apr 2018 20:09:47 -0700 (PDT) X-Google-Smtp-Source: AIpwx48inh0N7z3f+sbQ+hIu6ULagJv5c+J4/nw4GXcO4lhWwkoETvkFcDnuM/T1E66S0yqQFnrP X-Received: by 10.99.111.136 with SMTP id k130mr23432924pgc.378.1523243310956; Sun, 08 Apr 2018 20:08:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523243310; cv=none; d=google.com; s=arc-20160816; b=nelnUucN9u6bn5PsQVrY73/waRfBC0Fla/7Ls8jTE22axxSi4tA5sfKukwv8XuOFgS /n9N5Vrzrzqd5Qhlt6nXIOEYuCsvGh3Ory+T7jdFpV7X9TjBGRsYfz0Vlb1R3ErSLqft C9W4UoR7v7Tww7Roluy6F9I3g7jNBmpJNnezdFF7Rh9TpsKYO5FbVrvTvWUPaa00nK1N OjRqVZ5UIFVXvviedeMVEctGjpn9XQvF+Kdhqmc5BU3ijoNDfJROYt6TPXq55ksJDEIP spPrTsu+cyGblPaGBCpc9hhfbBHSwspjfoGZ4iY301ZimP41+9OxJEuuhYYlxdCUyWT1 9rgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=EtTI/C4wZ0VgGrlXFfebPVKjSr2A/v5vLKgx9rJ70nM=; b=O1zvlhddh4M4IFesNrEGcfdjZPg54PbzIm0rVtqC/XMdL1gLsyLKga+COpSQZnGxd9 EFm+Ce/VEUnaTKF7H4CnQ+2ZQ95sp0cWFDQBYkIItae8zgXEIBEDRfdNraR6A9YG49O1 Or3A0THFYy0KbXpJawjU4VZgiyiIrshCiyZlAtBC8miRnaM/OvLbjs7AhgITkCSM0Deu QJqOCUxVoXLLrTJD0Av+YfDZ8Qep7PS+XDrhiBpQCAbyS5CieKKZHLdjQeGJd0d8oRqo zUfoLhgDiEPkzajSCfpXOYcm7wmzLsuFWiZptbxU6hGS2dkyKCVS5y6sKZB0VFX2x2/I CgYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=apmqcHIi; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p2si11637483pff.253.2018.04.08.20.07.53; Sun, 08 Apr 2018 20:08:30 -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=@microsoft.com header.s=selector1 header.b=apmqcHIi; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932349AbeDICDT (ORCPT + 99 others); Sun, 8 Apr 2018 22:03:19 -0400 Received: from mail-co1nam03on0101.outbound.protection.outlook.com ([104.47.40.101]:32931 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756357AbeDIAcE (ORCPT ); Sun, 8 Apr 2018 20:32:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=EtTI/C4wZ0VgGrlXFfebPVKjSr2A/v5vLKgx9rJ70nM=; b=apmqcHIiJxgu/G/zVL0qFd6v+ajLcY8rofSm98rJGdj8/3mwMmbv06cX23aYWDyZby6hm62/US2vpmOWDL9Q6rb4XFtuuEJ9vddn8S77Ry03V8qK0zkIiTQx+v0C48kDLETW1C5L6XNzwrYBzK12TpbK8ypU6QxQouwfCzCL7QY= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB1126.namprd21.prod.outlook.com (52.132.132.166) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.696.0; Mon, 9 Apr 2018 00:32:00 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059%2]) with mapi id 15.20.0696.003; Mon, 9 Apr 2018 00:32:00 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Jerome Brunet , Stephen Boyd , Sasha Levin Subject: [PATCH AUTOSEL for 4.9 190/293] clk: scpi: error when clock fails to register Thread-Topic: [PATCH AUTOSEL for 4.9 190/293] clk: scpi: error when clock fails to register Thread-Index: AQHTz5k/y3OZZQ4X9Um+K//G7zkN7Q== Date: Mon, 9 Apr 2018 00:25:23 +0000 Message-ID: <20180409002239.163177-190-alexander.levin@microsoft.com> References: <20180409002239.163177-1-alexander.levin@microsoft.com> In-Reply-To: <20180409002239.163177-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR2101MB1126;7:WdC2j7nkqdX2aG8NKPN/APClE1PEco6QbWWJ2JPNhhzbUvHwfYBVh59loQJaaBC5AYVRML1mjTw97OWiFhZB81nEb805OyT+cQEn7cXy+BcXf+V1f7ihLSJHMn3QY8JFCq89pbBt2z23xG6xl+I/6myLOSzc+mnaZ/yEQF6za5C5XpAYdKdrxV7fKnzksllqmFwZ4q9LJ/H2ZA4OhvCJM9rSiAZXmbAAhpeMAatg2JK08R075rwugsw/nvGu1hVu;20:aoZSYGwInTLByTqfAr7WQ5q91mRf+eE0e+t9IzsJG0O5yAjxrkTwKzmzHtm7AyT4FT8pELtVPOqb1s9R9c64Zoy9Zk/B+UhqHD/RI9JCyig++xGvwSDCq4pc6PqdY9nlp0dE54cTlqqVPIf2bcT0TmdJ+I2IKr2xqd68TxQtZlg= X-MS-Office365-Filtering-Correlation-Id: 399294e3-ae9c-46bc-0f3a-08d59db14f0d x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(3008032)(48565401081)(2017052603328)(7193020);SRVR:DM5PR2101MB1126; x-ms-traffictypediagnostic: DM5PR2101MB1126: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(180628864354917)(89211679590171); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040522)(2401047)(8121501046)(5005006)(3231221)(944501327)(52105095)(3002001)(93006095)(93001095)(10201501046)(6055026)(61426038)(61427038)(6041310)(20161123560045)(20161123564045)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011);SRVR:DM5PR2101MB1126;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB1126; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(366004)(39380400002)(396003)(39860400002)(346002)(376002)(189003)(199004)(2616005)(476003)(81156014)(8676002)(81166006)(3846002)(486006)(2900100001)(6436002)(186003)(478600001)(72206003)(110136005)(54906003)(2906002)(86612001)(6666003)(2501003)(26005)(10090500001)(102836004)(6512007)(6116002)(14454004)(5250100002)(10290500003)(1076002)(575784001)(446003)(3280700002)(3660700001)(11346002)(8936002)(25786009)(59450400001)(6506007)(106356001)(4326008)(107886003)(36756003)(105586002)(53936002)(86362001)(66066001)(6486002)(99286004)(5660300001)(316002)(22452003)(305945005)(76176011)(97736004)(68736007)(7736002)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB1126;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: NCWlIy8MHdX4vLtKKWWl+kcH01HWVCcK1U2QQFa7Gd/KxFeniKa4KfUUAKfuu6v5bNJK4CIro5PZ5DfIPUYhcmRk6Dymnu26r03sf4ZKcTUkrcxz4E6GRlWQ28luaRc5/C/pGtrjmc2/wTQAquPhUDUckGJUtxj+zT3pD+0SjtBTLUUD4pJeWNHYNDPfXqF800/y1WXNiWGo1wG7awKjGlCDfQpdqdvzYcqjsrJQbXiNSKNH3AqwENvNHsyuuCjzzs6uZRPBmNMcP4oPJ6eQHcrkluQTInkGRmB2XBEvcc0acw0A4R7phX1Gam2ecrK4wVv06g56BXX4SFAFodEYqjDNWvvsc3sZ9fmXrgK2zE/S/6C3MOPDu5Gbts38jWNjWUs0iT4U8bipTLGJrdBog5h+FS4SdpZZj2+DUfhM62A= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 399294e3-ae9c-46bc-0f3a-08d59db14f0d X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:25:23.0346 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB1126 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jerome Brunet [ Upstream commit 2b286b09a048df80fd5f7dfc5057c2837679a1ab ] Current implementation of scpi_clk_add just print a warning when clock fails to register but then keep going as if nothing happened. The provider is then registered with bogus data. This may latter lead to an Oops in __clk_create_clk when hlist_add_head(&clk->clks_node, &hw->core->clks) is called. This patch fixes the issue and errors if a clock fails to register. Fixes: cd52c2a4b5c4 ("clk: add support for clocks provided by SCP(System Co= ntrol Processor)") Signed-off-by: Jerome Brunet Reviewed-by: Sudeep Holla Signed-off-by: Stephen Boyd Signed-off-by: Sasha Levin --- drivers/clk/clk-scpi.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/clk/clk-scpi.c b/drivers/clk/clk-scpi.c index 96d37175d0ad..e44b5ca91fed 100644 --- a/drivers/clk/clk-scpi.c +++ b/drivers/clk/clk-scpi.c @@ -245,10 +245,12 @@ static int scpi_clk_add(struct device *dev, struct de= vice_node *np, sclk->id =3D val; =20 err =3D scpi_clk_ops_init(dev, match, sclk, name); - if (err) + if (err) { dev_err(dev, "failed to register clock '%s'\n", name); - else - dev_dbg(dev, "Registered clock '%s'\n", name); + return err; + } + + dev_dbg(dev, "Registered clock '%s'\n", name); clk_data->clk[idx] =3D sclk; } =20 --=20 2.15.1