Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp221822pxf; Thu, 25 Mar 2021 02:29:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzllomQaYUVZr7VEmWUwpZF8tEnkArFQvcGW0zlVddXFdQ0w4kQxb/+wlE8vZ4sx9Prz7ZY X-Received: by 2002:a17:907:76ed:: with SMTP id kg13mr7907514ejc.99.1616664543410; Thu, 25 Mar 2021 02:29:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616664543; cv=none; d=google.com; s=arc-20160816; b=tBPWmhiNcFFI4Kr7QuYS7b6/esGWIxbMil3CPSkemT2v/DkUeCQ9LfHHoKdivmXSII 6hyokOefaoFaM8jlMAupHG0gx9klHkXoEdEbu35sh0EFiL0WTS2JIcSGvNuIJDv0uzlo +gZgyrqZnsoLEfAyCYUL9ylBdy4I+AApo0xetBYLq3VVUyclGBtO8NOMmUI3OVEw57zb F63A66tU/cy8rTnLU33moC/WcAbWmVTGR7AXSvsCOYoj7C5utZdCCcl1eLHPoG1w6DEU NA35UcWsIJwiQ7bu/8DR81N2A/5Sb+YzCRUcEVDwFPVHLgImKZRklu/4GJimtEqt8V0A i8kg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=PsTQ4/W7bLkl30GvO3O8c17IK1eiosbGsbRf97AFsMI=; b=p1Wrx/hsSxDUlMX+zZ6iWOsi9SzQhgF0Ha2dCWViBgW07Vm+K03mGh4zfkjy9JqqmD bM3a/x2+UduvzDWkN3bqhc7ZZC4GhILk5SIHl77B40xAazIADRvt2LOzn6CX7vVyDjvW Ige8TfVeV+hZj45awgebo9EgWaZ5oEAddULny4rauh4+6b0f3LaWk/K5NlG6YOCkMs7q kefLFpr1CEemN35NJXr6lKjGpoyL7tAbvO5iY/i61oJgrDQuBikOJ/P+9xsRxm3Kk7Qc 40bHMpltXBLDvJCNuVRnw81jDG48nwjXqSj9Z3pU8TbtPaSqoiVlu0haOSNDGbldLsQf HONw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HVKgPNxV; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id kb16si3238270ejb.190.2021.03.25.02.28.40; Thu, 25 Mar 2021 02:29:03 -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; dkim=pass header.i=@linaro.org header.s=google header.b=HVKgPNxV; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229576AbhCYJ0y (ORCPT + 99 others); Thu, 25 Mar 2021 05:26:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41648 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229581AbhCYJ0i (ORCPT ); Thu, 25 Mar 2021 05:26:38 -0400 Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B5A2CC06174A for ; Thu, 25 Mar 2021 02:26:36 -0700 (PDT) Received: by mail-lf1-x134.google.com with SMTP id w37so1452153lfu.13 for ; Thu, 25 Mar 2021 02:26:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=PsTQ4/W7bLkl30GvO3O8c17IK1eiosbGsbRf97AFsMI=; b=HVKgPNxV8Rf1c20+mCwDuHYNBdKd6GG1aHaY4yc1nl8fXusfU5VF105dDsB/Nsd1Yz 9WzWNTIUo47V3G+U+NpNgHDMAgixPFWE3aaRLGw+V9io6is6264ogjRvShX74IzF7JsU rX5Jqd7DFP8rnHdCRtaxUSx8WTEpW4oigKOdHXzfnNe/Gk3cAwj4RrTEpjGx3vZVEiTX 3j25f5w3xN53tvZrPXmdQCmCStORxvgsbrD0jJFD1+NojU0bi7iBO/UNos1oB61UjJEY dZbc3NGr2ZXLRmDXJcQFDJHmqv2XY2eO45JnxKDxnDeMLgp7JrAHmiEoHRUj4kxEcsjb R8CQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=PsTQ4/W7bLkl30GvO3O8c17IK1eiosbGsbRf97AFsMI=; b=bxDVjHAfczVemBAUAp4m1qFva4LifmDJ8kxyWsUsz+pGRqtfxCMuM/YFmAGHUj0aXw 6jeY7EN4z2daU0woWRN8gQUOcDUg1bhhVWOPavSgEQFufPlEgOJq8u1WHe0GtQO+OunC TB1Y+hQeRkhOGcqs5kEOwxfbbqYOhpiYnOoIsV6I5drfyHxwLRnr68arRePVjJhP8KzK hfVaOOO0x6zwIdUBxKkDQIlYbFQlg+kinRYR5L0vweV+Y1uUcEIV1UlO3qGd7Tf/FS6G 3iNyY702mQcfQ79yFgb9SqK2z91MurJDMXKw0obqd8cJTSLew9+mzieEVXGAg8ugIp0E fkWQ== X-Gm-Message-State: AOAM533/5FdthIdbc6u0INX3XHG+r6cnyxeGFFzzQurYIADqKnHRdxGk WoBo72XLn+hCXuTbn0VVLsDf2AK/llRDmZIuwQ9y1g== X-Received: by 2002:a05:6512:243:: with SMTP id b3mr4577150lfo.529.1616664395375; Thu, 25 Mar 2021 02:26:35 -0700 (PDT) MIME-Version: 1.0 References: <20210323131002.2418896-1-arnd@kernel.org> In-Reply-To: <20210323131002.2418896-1-arnd@kernel.org> From: Linus Walleij Date: Thu, 25 Mar 2021 10:26:24 +0100 Message-ID: Subject: Re: [PATCH] pinctrl: microchip: fix array overflow To: Arnd Bergmann Cc: Lars Povlsen , Steen Hegelund , Microchip Linux Driver Support , Arnd Bergmann , Zou Wei , Linux ARM , "open list:GPIO SUBSYSTEM" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 23, 2021 at 2:10 PM Arnd Bergmann wrote: > From: Arnd Bergmann > > Building with 'make W=1' shows an array overflow: > > drivers/pinctrl/pinctrl-microchip-sgpio.c: In function 'microchip_sgpio_irq_settype': > drivers/pinctrl/pinctrl-microchip-sgpio.c:154:39: error: array subscript 10 is above array bounds of 'const u8[10]' {aka 'const unsigned char[10]'} [-Werror=array-bounds] > 154 | u32 regoff = priv->properties->regoff[rno] + off; > | ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~ > drivers/pinctrl/pinctrl-microchip-sgpio.c:55:5: note: while referencing 'regoff' > 55 | u8 regoff[MAXREG]; > | ^~~~~~ > > It's not clear to me what was meant here, my best guess is that the > offset should have been applied to the third argument instead of the > second. > > Fixes: be2dc859abd4 ("pinctrl: pinctrl-microchip-sgpio: Add irq support (for sparx5)") > Signed-off-by: Arnd Bergmann Patch applied. Yours, Linus Walleij