From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DCCA4C48BCF for ; Wed, 9 Jun 2021 08:03:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C2E7661364 for ; Wed, 9 Jun 2021 08:03:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237719AbhFIIFD (ORCPT ); Wed, 9 Jun 2021 04:05:03 -0400 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:50751 "EHLO relay3-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237471AbhFIIDl (ORCPT ); Wed, 9 Jun 2021 04:03:41 -0400 Received: (Authenticated sender: clement.leger@bootlin.com) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id 6005260014; Wed, 9 Jun 2021 08:01:45 +0000 (UTC) From: =?UTF-8?q?Cl=C3=A9ment=20L=C3=A9ger?= To: Michael Turquette , Stephen Boyd , Nicolas Ferre , Alexandre Belloni , Ludovic Desroches Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] clk: at91: fix count of periph clocks passed to pmc_data_allocate Date: Wed, 9 Jun 2021 10:01:44 +0200 Message-Id: <20210609080145.44226-1-clement.leger@bootlin.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When allocating clk_hw structure, only the periph32 clocks are considered. Since sama5d2_periphck are also added to the phws there is currently an out of bound write. Fix this by adding the count of periphck to periph32ck. Signed-off-by: Clément Léger --- drivers/clk/at91/sama5d2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clk/at91/sama5d2.c b/drivers/clk/at91/sama5d2.c index 3d1f78176c3e..663b73a032ee 100644 --- a/drivers/clk/at91/sama5d2.c +++ b/drivers/clk/at91/sama5d2.c @@ -170,7 +170,7 @@ static void __init sama5d2_pmc_setup(struct device_node *np) sama5d2_pmc = pmc_data_allocate(PMC_AUDIOPLLCK + 1, nck(sama5d2_systemck), - nck(sama5d2_periph32ck), + nck(sama5d2_periphck) + nck(sama5d2_periph32ck), nck(sama5d2_gck), 3); if (!sama5d2_pmc) return; -- 2.32.0 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 03F15C47095 for ; Wed, 9 Jun 2021 08:44:18 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BEE7A61375 for ; Wed, 9 Jun 2021 08:44:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BEE7A61375 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bootlin.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=qcOZeG3sr6xF99JR1haxllDpFyP88C9MAYzCoW+eenU=; b=i0eJzl8koufPeU 8/nSxUAwwaN0nGVjePkAjlWSJzT0ZsM7PbN2rFioy2f6JgiLt7QyO+uW+xmaOaK5NejSxv62USG0u 2vVpPuaraYh1sgbn604JHed8KqYbk+Af9vQUjmDLZ88BP+n/hpJgLKyvRPS7KcPLcRvKnvM91CQM+ 3pVTup7Yw6Vth4qRI5zKwYQpPoGaiO/ypYnazsoqZvqwGY36E+GpRUXTVv3D6UGoPncOfDAloZ7mo Ty+5Vo7mXmSsN/FG1UZc3sDClsZeqNF4Snz4qoPHVep8VhHYqsQ5+C/nkBQLb9mCFB6At9sgWpJUb 3MfsCc74kbpWFmB7ok+Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lqtl5-00CPwd-D3; Wed, 09 Jun 2021 08:40:20 +0000 Received: from relay3-d.mail.gandi.net ([217.70.183.195]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lqt9q-00CF7i-Ie for linux-arm-kernel@lists.infradead.org; Wed, 09 Jun 2021 08:01:52 +0000 Received: (Authenticated sender: clement.leger@bootlin.com) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id 6005260014; Wed, 9 Jun 2021 08:01:45 +0000 (UTC) From: =?UTF-8?q?Cl=C3=A9ment=20L=C3=A9ger?= To: Michael Turquette , Stephen Boyd , Nicolas Ferre , Alexandre Belloni , Ludovic Desroches Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] clk: at91: fix count of periph clocks passed to pmc_data_allocate Date: Wed, 9 Jun 2021 10:01:44 +0200 Message-Id: <20210609080145.44226-1-clement.leger@bootlin.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210609_010150_787410_242BA651 X-CRM114-Status: GOOD ( 11.07 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org V2hlbiBhbGxvY2F0aW5nIGNsa19odyBzdHJ1Y3R1cmUsIG9ubHkgdGhlIHBlcmlwaDMyIGNsb2Nr cyBhcmUgY29uc2lkZXJlZC4KU2luY2Ugc2FtYTVkMl9wZXJpcGhjayBhcmUgYWxzbyBhZGRlZCB0 byB0aGUgcGh3cyB0aGVyZSBpcyBjdXJyZW50bHkgYW4Kb3V0IG9mIGJvdW5kIHdyaXRlLiBGaXgg dGhpcyBieSBhZGRpbmcgdGhlIGNvdW50IG9mIHBlcmlwaGNrIHRvIHBlcmlwaDMyY2suCgpTaWdu ZWQtb2ZmLWJ5OiBDbMOpbWVudCBMw6lnZXIgPGNsZW1lbnQubGVnZXJAYm9vdGxpbi5jb20+Ci0t LQogZHJpdmVyc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