Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp2007366rwn; Fri, 16 Sep 2022 04:27:52 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6GvRJ2UPde3cxYsi+fVaz5jkPfXApiPO3U/FYG0eMmfei8v34H//8BQV9MaoD/aLs8ZguH X-Received: by 2002:a17:907:2c74:b0:77d:5a0e:bb8f with SMTP id ib20-20020a1709072c7400b0077d5a0ebb8fmr3088173ejc.579.1663327672679; Fri, 16 Sep 2022 04:27:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663327672; cv=none; d=google.com; s=arc-20160816; b=TlgKA9g0FKHtggW09lrKhQS/uFFQH0MyAngmqcWVjEyw9sCFb3exHxeLHLqSeiHPWu cnTuZ+Y3JLBWeDo04fReik3A9Id1LikcM3MpolbmfovBWciaaw1KzqeSdpNEfZI+OI62 qIc05EuxAqFWlF9rKjtPEsOcnj3A5dZ7LZY3VrhCHDY9UB34DKF8ULPdZRQLig5gbmA5 TgGw/W0vHIkq3mUsTH5ecmAGaN0qOItMDKr3jx79rph+r0tWjmL2qZfS4a6N0p3FB1Z2 9FSetzDVov68FCIWTPr22wKSlsTOGnugx7CvmXWlXmw+OTFop/yoiWqtmLVvpYqhsPDA fYOw== 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=icUBRZO3jxS3eTTQZGMHo/3Ro+JI8Iz+Fgnw4zMxh1s=; b=bIJfrVY4jTYsZMN7X81ZWUts3adlAS9SYNg2/pKqHYxuBxtpyyPWMBax4HNdCGESJn sAml0XGHe5L69r7u7BWJR5sDNwPcoiokUqPaBfRJze1U98y7/usxllnyCnVxMJIrDdZX CG6a6GyPUmaKv1NIaEn1P3qwG90su8XxzvmUeLrYlkSvWpyoVrN3YkqlWpJe4pqWaShj jXrbGX/q9kK5kJBxopquheuxAMEEHPuN4bg79mUtl9Hythx0v8fH4WpGjd/xIy19AA83 kPADm1I7BR1bpK1xYRLhydi4LVbmm5MbXGZIqauo/yFv31GMpkB+61l1TI/wdT2R7Ht9 AmWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mU59pLpv; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id oz31-20020a1709077d9f00b0077c80ffcffesi9227448ejc.726.2022.09.16.04.27.13; Fri, 16 Sep 2022 04:27:52 -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; dkim=pass header.i=@linaro.org header.s=google header.b=mU59pLpv; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230233AbiIPLTV (ORCPT + 99 others); Fri, 16 Sep 2022 07:19:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229999AbiIPLTT (ORCPT ); Fri, 16 Sep 2022 07:19:19 -0400 Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [IPv6:2a00:1450:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 936C24DF30 for ; Fri, 16 Sep 2022 04:19:16 -0700 (PDT) Received: by mail-ed1-x52c.google.com with SMTP id b35so31048360edf.0 for ; Fri, 16 Sep 2022 04:19:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=icUBRZO3jxS3eTTQZGMHo/3Ro+JI8Iz+Fgnw4zMxh1s=; b=mU59pLpvgebTMWSxaEMVYRYLsvuehZDwksFV4RuU9EVVQxnF8Sj5T3QpMfGM7wGc3t pWsMLdz97fwFP+uQ+tedL5b8P3hMcdYEb5giZ2Ma9jAKsbuvAaMOKsT+6j2gje++qp4n 72XGo9nKMcGw6szjbchS8faU06IDRdyZIjuy1WdCJTO6KLkFUx+/7fFnCETXrDVhsv6w yuDsE7GIqckoRAct8SOzsUbvhd4HAPkZpWTleQXtgZzUNEzqH4+zmnhk7G3duvBLmC9f u4jrXQNZKhUUWwwTmPCPGMChl7/rmBNkU2/Rv66zoc1ZEXeecPYcF2A/ufcZ83F5qPeu hKRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=icUBRZO3jxS3eTTQZGMHo/3Ro+JI8Iz+Fgnw4zMxh1s=; b=NYbqnAGc+MEGo5F7DiND+skNYdrz7dMY80x9S9ibgw1sLoy6PQrIuVtPEFveLS/FCZ ua3pMDfkij6SkRgeNfD4UVwgDhLOtQye4Nb8ZS1CY0LS0QvAxoBg06EMOkjVIkvxz6wl PqZC/OVp4Wh9IF9qF6mBvLLwYX0t+spfwjYKK4GwR7cOYxUPgdjNlNCwAtzmvlYYzVvU OFlQFuSXlcCM5DGO1GWh8qABHUdk83luU1jslAYfcJr7IwRwtQRSyzzW9u+KJQygWsAx EsVdZ5cbMf0+vm5bTFOqeyaeKVjiuNaBv2vWCAsnSwGqtK1+ngvO6DyP0HBhYSXVJ6rk WxAQ== X-Gm-Message-State: ACrzQf1hWEj5ODW4Nr11qzvts9tX98zax5yObEVJrEt6El9MpXwkFJDE hwRrlwN+AscRt821R2FHmj+JFn7OYDTrvLkxAa6LZg== X-Received: by 2002:a05:6402:190f:b0:452:d6ba:a150 with SMTP id e15-20020a056402190f00b00452d6baa150mr3582318edz.126.1663327155181; Fri, 16 Sep 2022 04:19:15 -0700 (PDT) MIME-Version: 1.0 References: <20220916110118.446132-1-michael@walle.cc> In-Reply-To: <20220916110118.446132-1-michael@walle.cc> From: Linus Walleij Date: Fri, 16 Sep 2022 13:19:04 +0200 Message-ID: Subject: Re: [PATCH] gpiolib: fix OOB access in quirk callbacks To: Michael Walle Cc: Bartosz Golaszewski , Dmitry Torokhov , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 On Fri, Sep 16, 2022 at 1:01 PM Michael Walle wrote: > Commit a2b5e207cade ("gpiolib: rework quirk handling in of_find_gpio()") > introduced an array of quirk functions which get iterated over. But a > sentinal value is missing. Add it. > > Fixes: a2b5e207cade ("gpiolib: rework quirk handling in of_find_gpio()") > Signed-off-by: Michael Walle Looks correct, an alternative would be to have the for-loop use ARRAY_SIZE() but this is just as good. Reviewed-by: Linus Walleij Yours, Linus Walleij