Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2358394rwd; Wed, 14 Jun 2023 01:27:48 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6zH8ilwqgfFEriDptLgGR0QSO0vc4dNenoH4R6F+g7VpIcYhqsYBIumedv5wu6Sf+HIusu X-Received: by 2002:a17:902:d4c2:b0:1b2:5ade:9ebb with SMTP id o2-20020a170902d4c200b001b25ade9ebbmr11931521plg.2.1686731268046; Wed, 14 Jun 2023 01:27:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686731268; cv=none; d=google.com; s=arc-20160816; b=fgKND64gwiUXOuPY/d0TTnk3hSMWEVYl8PP0oJAwZM8KNEz4OCwo41ooAGiBsBTxDg dAcbKrOfnELfOP9FPGixeuU8LQT9Hi4BvrFdvnkGUaPSjt5de+hPkswMjsOys0L3dLw+ Mg7kBU0dpC1jcl3hoFwAEb9mg+FzENuFv6PP2VpeZTPcKGVbe35WCm2VjhJg8S1XHRcf vj1GgdndgLimm90dKH8H2tZwjImivST0EqTVV77dgtjI8DNDB8RaaiMnqmVQ+tKwDnpf VPnSzSAGenwGjCdz6XGyVzVJz6mvg0LkXWXBTaYLhjSUmZ5a3viq64C+u4N0hC6C8x3U kdyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=oCw5FmzNobntfjSQTMfisQ8AxYDouAcFeZTPv6w6qRo=; b=Nf3vaOFq98S7rmA+FvTV+Y4D/zPC0qnzAPmWv8ENcrwWtn2XYpJ2hJnv5NcJ9xihWY ojTXSd/Mi0DuJ0WcRFOom1L6ctisg8EzejpfCJCjY7qCeiMgFZKCV+KBnRrZxgEObTe8 wVd1ceu98we8YIbpH92nPxUzZKVO/7jUyA7Pc1XgaumuRkfj3ACHxnxOTs6BPMQZcnEg aO6h8aLd2B2LJh3ybC64+3Uaw017BsnYqhL1ZTAwkz6niol+2KtToUFW5hzKM/GDfTjh +aCn8DT5UVyTY2JO1e9N+LO9wNJk9EPUlnmQkzFn5I6nuK59J2Bw9uBtsBI+ykvwrUNT zqtA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a16-20020a170902b59000b0019ca7a76d68si10140967pls.67.2023.06.14.01.27.35; Wed, 14 Jun 2023 01:27:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243620AbjFNIIs (ORCPT + 99 others); Wed, 14 Jun 2023 04:08:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43468 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243553AbjFNIIf (ORCPT ); Wed, 14 Jun 2023 04:08:35 -0400 Received: from muru.com (muru.com [72.249.23.125]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 530701FCC; Wed, 14 Jun 2023 01:08:09 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTPS id B59988027; Wed, 14 Jun 2023 08:07:41 +0000 (UTC) Date: Wed, 14 Jun 2023 11:07:40 +0300 From: Tony Lindgren To: "Gustavo A. R. Silva" Cc: Russell King , Peter 'p2' De Schrijver , Kevin Hilman , linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH][next] ARM: OMAP2+: Fix -Warray-bounds warning in _pwrdm_state_switch() Message-ID: <20230614080740.GH14287@atomide.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Gustavo A. R. Silva [230608 07:11]: > If function pwrdm_read_prev_pwrst() returns -EINVAL, we will end > up accessing array pwrdm->state_counter through negative index > -22. This is wrong and the compiler is legitimately warning us > about this potential problem. > > Fix this by sanity checking the value stored in variable _prev_ > before accessing array pwrdm->state_counter. > > Address the following -Warray-bounds warning: > arch/arm/mach-omap2/powerdomain.c:178:45: warning: array subscript -22 is below array bounds of 'unsigned int[4]' [-Warray-bounds] Thanks applying into omap-for-v6.5/cleanup, seems this can wait for the merge window. Regards, Tony