Received: by 10.192.165.156 with SMTP id m28csp1117596imm; Wed, 11 Apr 2018 12:46:24 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/kx5vc3sLOfPrcznQ6j2f9eWef2rU0hA+2AoA+N+t22+vRO6/CNeqWPZeMobOjmhuFimB0 X-Received: by 2002:a17:902:7405:: with SMTP id g5-v6mr6578113pll.4.1523475984363; Wed, 11 Apr 2018 12:46:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523475984; cv=none; d=google.com; s=arc-20160816; b=iXDwKKm6zJwSNVM1obRsqnonoTObvQwO4Elb0fAG92GsIWLhd/0G/EQqWtycGxFUDr IqByT6UYsd9cImrU9wFtbgJacJ22KNB3dtMKK3bA1BA6xR5ZFZBP1lRN9LsjeRtHmQQ3 GH/0cWYbOGwUf+h3heBW5nwt1LWV8WVgS5NJ9Mnr9Oxy32P7224wB21G08SV86iQpNzw Yaiq+Z0Ce7uLS8TwYDuGYbPZqZaTsUXT8vnuEG5lCSskxLJ1KQuV+G57Ym/n8c60FEF2 B3Ez2M0UQCo87AKzeDy6PJUYeSf7mPWnzS2Bc0bxVN/IfWbVXMikakcF5kYP5wSNvo59 xngA== 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=aXvN0yBYFfYk4R4pJbCBIMFbVZRG53monce3wZ/T6IQ=; b=QJJQgCWYhu2X1aL/mOnOkmd8LvEWfLN0LPkzVpoMpqeh5PerBvT5EJDlgVHHwDN0dV zMDkLJB1Qz8juGXkpmH81JpKzBWEEWviGFysuYmtzZZb6MBRnDxhgeIkUQ8NljDDc0hh xRdGUe5byAMMd9OIS1GcMOpbu0/t8znJzIJCCFWeb0mIyqoy0wGLhngCR08Ha4CW8yZK Mv5cHMloc4wwKiiCqtT3oLPx/xZgWR+QKJ3B2mmcBETaHsuSMqfkFVfHtScKsGyEZm+T BEZ4cMoQJtKp9elxj6HlrjtikiYfJou5ob9ltMeG/kmcR3ee/sJHs+Cj52w1k8t6Fqmk 9j3A== 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 f64-v6si1750552plf.624.2018.04.11.12.45.47; Wed, 11 Apr 2018 12:46:24 -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 S1756747AbeDKTAg (ORCPT + 99 others); Wed, 11 Apr 2018 15:00:36 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:37804 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756704AbeDKTAe (ORCPT ); Wed, 11 Apr 2018 15:00:34 -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 6F9409C1; Wed, 11 Apr 2018 19:00:33 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Michael Turquette , Stephen Boyd , Sudeep Holla , Sasha Levin Subject: [PATCH 4.9 172/310] clk: scpi: fix return type of __scpi_dvfs_round_rate Date: Wed, 11 Apr 2018 20:35:11 +0200 Message-Id: <20180411183630.035784398@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180411183622.305902791@linuxfoundation.org> References: <20180411183622.305902791@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.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Sudeep Holla [ Upstream commit 7374aec95636ca39409545eba4ef5ff3125c2346 ] The frequencies above the maximum value of signed integer(i.e. 2^31 -1) will overflow with the current code. This patch fixes the return type of __scpi_dvfs_round_rate from 'int' to 'unsigned long'. Fixes: cd52c2a4b5c4 ("clk: add support for clocks provided by SCP(System Control Processor)") Cc: Michael Turquette Cc: Stephen Boyd Signed-off-by: Sudeep Holla Signed-off-by: Stephen Boyd Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/clk/clk-scpi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/drivers/clk/clk-scpi.c +++ b/drivers/clk/clk-scpi.c @@ -71,15 +71,15 @@ static const struct clk_ops scpi_clk_ops }; /* find closest match to given frequency in OPP table */ -static int __scpi_dvfs_round_rate(struct scpi_clk *clk, unsigned long rate) +static long __scpi_dvfs_round_rate(struct scpi_clk *clk, unsigned long rate) { int idx; - u32 fmin = 0, fmax = ~0, ftmp; + unsigned long fmin = 0, fmax = ~0, ftmp; const struct scpi_opp *opp = clk->info->opps; for (idx = 0; idx < clk->info->count; idx++, opp++) { ftmp = opp->freq; - if (ftmp >= (u32)rate) { + if (ftmp >= rate) { if (ftmp <= fmax) fmax = ftmp; break;