Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp147580pxf; Thu, 25 Mar 2021 00:12:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw80gt285/FUcrhpxhEvox576xlP2YPswPJR0zrknb8gMmr23ZnDHXidCOZzcXUKivZqleb X-Received: by 2002:aa7:cb4d:: with SMTP id w13mr7409430edt.249.1616656355878; Thu, 25 Mar 2021 00:12:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616656355; cv=none; d=google.com; s=arc-20160816; b=f+pgkzJTn0aEaGlAIvaT9fDvd9T6aXHsYX3U3db2D/NvFFp5DpsJGlncQrjG/W+4U7 pomSNAorQSM+108c8KzO4w72yVLiL8etEzkOoovVgrGpYsRs+jwoq3fbkoHRyJW+L8fF g1TbV4tqIbPGv8uIYgzDuokxkiwRlUqUv7zMbTW0gbxME1e2LqlJlddLN2ed383s4d+r xtPaQ3bGZ9D3HWxHA/Rxcbf08aWsbpV1AriQO2N/xU4ToWRFDOGRYAOjsVZFz6aKlNI1 csC2a9QCqd5Ig1A85WyUWQwu7dBQBWnPYRnVyznlWqQkWVl3U4Xd7sk9rJuZ2llCN5hg JRyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=SugKZ8R0aCpHDO7cwlvMvpnPEoltl2fD6jSzWWe0DPg=; b=EwJU4vBuxrxm87P8jwuT9D2JDm+dqaaiT7gPkeOJOJ+rIbG2jLT2PoR51RI7Pkiffz bSC1jlkhXxaWwWhYnnLR2L3uuulffmhsstBMj7D12X2k7sCe/QUXCpIIyN18BmaqBeRw bkA2+e2RsA1tb1bldn6s+B5YPqVuykbSHXNKkNpDeE6Bc0hhtaLPTnOGnx3S4tptOJUm 5fXq6zhCwtzE0lkacQA5CKoIGi6RZI+88w5CLoGTiu4hVgJqpmqT1iHPfELud1MuEcaS Jaza9asPatOZLpYjNK4CvA+GlExWSo2LvFU4/M+xPGts4QCjqDPeFnRU+sMvA2vWA8Hm VoDg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a1si3531267eds.169.2021.03.25.00.12.12; Thu, 25 Mar 2021 00:12:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229870AbhCYHJN (ORCPT + 99 others); Thu, 25 Mar 2021 03:09:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40068 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229448AbhCYHJH (ORCPT ); Thu, 25 Mar 2021 03:09:07 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 996C8C06174A for ; Thu, 25 Mar 2021 00:09:06 -0700 (PDT) Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lPK6y-0007Xe-A6; Thu, 25 Mar 2021 08:08:56 +0100 Received: from pza by ptx.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1lPK6w-0000gc-Ew; Thu, 25 Mar 2021 08:08:54 +0100 Date: Thu, 25 Mar 2021 08:08:54 +0100 From: Philipp Zabel To: Liu Ying Cc: Arnd Bergmann , David Airlie , Daniel Vetter , Arnd Bergmann , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Marco Felsch , Sam Ravnborg , Joe Perches , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] [v3] drm/imx: imx-ldb: fix out of bounds array access warning Message-ID: <20210325070854.GC22419@pengutronix.de> References: <20210324164750.3833773-1-arnd@kernel.org> <42e9cf4dd5f12ca437787d80fee0945b0af9424c.camel@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <42e9cf4dd5f12ca437787d80fee0945b0af9424c.camel@nxp.com> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-IRC: #ptxdist @freenode X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-Uptime: 08:08:16 up 35 days, 10:32, 66 users, load average: 0.33, 0.39, 0.40 User-Agent: Mutt/1.10.1 (2018-07-13) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 X-SA-Exim-Mail-From: pza@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 25, 2021 at 10:03:23AM +0800, Liu Ying wrote: > On Wed, 2021-03-24 at 17:47 +0100, Arnd Bergmann wrote: > > From: Arnd Bergmann > > > > When CONFIG_OF is disabled, building with 'make W=1' produces warnings > > about out of bounds array access: > > > > drivers/gpu/drm/imx/imx-ldb.c: In function 'imx_ldb_set_clock.constprop': > > drivers/gpu/drm/imx/imx-ldb.c:186:8: error: array subscript -22 is below array bounds of 'struct clk *[4]' [-Werror=array-bounds] > > > > Add an error check before the index is used, which helps with the > > warning, as well as any possible other error condition that may be > > triggered at runtime. > > > > The warning could be fixed by adding a Kconfig depedency on CONFIG_OF, > > but Liu Ying points out that the driver may hit the out-of-bounds > > problem at runtime anyway. > > > > Signed-off-by: Arnd Bergmann > Reviewed-by: Liu Ying Thank you, applied to imx-drm/fixes. regards Philipp