From patchwork Tue Sep 20 14:27:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Frattaroli X-Patchwork-Id: 607813 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 64C9AC54EE9 for ; Tue, 20 Sep 2022 14:27:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230148AbiITO1r (ORCPT ); Tue, 20 Sep 2022 10:27:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55042 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229984AbiITO1q (ORCPT ); Tue, 20 Sep 2022 10:27:46 -0400 Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com [IPv6:2a00:1450:4864:20::52a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C28D7226; Tue, 20 Sep 2022 07:27:45 -0700 (PDT) Received: by mail-ed1-x52a.google.com with SMTP id q21so4084906edc.9; Tue, 20 Sep 2022 07:27:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date; bh=Liib93EzAVK4sIXWmleEPgo27rMYZRDPIdCFkLHuB5M=; b=dMG2QRyt14LehNiiB+J9RwfNaOh3XMRlofrRUiXp8eEerZ/Y/yxuZlzRufNhvJsiIP 79tJAxppdISgWCmQUPj002Y1c1meWmKOfisjkkJ+LG5hzbQ25z6HR9rXB3z0HcpLxQAw +gJELaz3TPiaWSd1DRz3dn39Pt5ocYQkl9aQ9xpL7rXGI8rKQMzDsa2xl4EMlcFGOFzH wcY3BMLtXDBa6rWTP6Qv1rSXWLw8jCVg9cyGMueXO/XLJIPTdY/uigEm9bHlwW38NEXm YBtt/Wbx9bp3/NG7czzZQuhwGu3nklQFFfn9ixLnTHQ+aDQIPl9biEExxyYaon6aAkYz Aing== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date; bh=Liib93EzAVK4sIXWmleEPgo27rMYZRDPIdCFkLHuB5M=; b=7lRqj3pg4v1NtnM78s5Z0jOwJ5lUMWZtfMnMJy08ThEXosATRic0ybK+ZCKkH5bZj5 PgMDcMzvdFyW0M8XEEvDAB7V0e+ynsFx5jine6ClgK6dErsSNE/fb+zjQYBUU+NOIG7d meb9Hiw+BqeYdnIJ0dq5eegPQGEsoPqDrhEe6XI8AKskaQ/QYib8y2lUqqmq4Zr5ofm8 diaIxk/bL/7SHvEg8OskyqLFTWOjKjhPALS96brgkg2OiraRIvAvi0yvMW8tVGJGsbps +hWq0TNZKgPfwpSAqAgAvhZ30T0zYM2z0cSFyHbbgyjJPXPpbLPXuOYeEX9+lKpKnqyj CbwQ== X-Gm-Message-State: ACrzQf3MbuLxcl4JUKs7/Y3GKQhrufQMWznQ887ONOhAIkB5YbhUTobL MnkNx2DQX54m0etj0hyXt8E= X-Google-Smtp-Source: AMsMyM7coyvmIfxhR6pD9GxGAVD7jsOgaRM34Cdu4jxKnWEkpw364h10JilpoeF3EBQetit6MVb/bw== X-Received: by 2002:a05:6402:298e:b0:451:129e:1b35 with SMTP id eq14-20020a056402298e00b00451129e1b35mr20165670edb.79.1663684064221; Tue, 20 Sep 2022 07:27:44 -0700 (PDT) Received: from localhost.localdomain (84-72-105-84.dclient.hispeed.ch. [84.72.105.84]) by smtp.gmail.com with ESMTPSA id s4-20020a1709066c8400b0077fb63da010sm971442ejr.114.2022.09.20.07.27.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Sep 2022 07:27:43 -0700 (PDT) From: Nicolas Frattaroli To: Linus Walleij , Bartosz Golaszewski , Dmitry Torokhov Cc: Nicolas Frattaroli , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] gpiolib: Fix missing array end sentinel in quirks array Date: Tue, 20 Sep 2022 16:27:18 +0200 Message-Id: <20220920142718.633062-1-frattaroli.nicolas@gmail.com> X-Mailer: git-send-email 2.37.3 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Without the sentinel, the loop never actually terminates if there are no quirks, and wreaks havoc across the kernel resulting in a juicy panic. Fix this by adding a NULL at the end. Fixes: a2b5e207cade ("gpiolib: rework quirk handling in of_find_gpio()") Signed-off-by: Nicolas Frattaroli --- drivers/gpio/gpiolib-of.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c index 95be5f0d2623..1b60cd04883f 100644 --- a/drivers/gpio/gpiolib-of.c +++ b/drivers/gpio/gpiolib-of.c @@ -498,6 +498,7 @@ static const of_find_gpio_quirk of_find_gpio_quirks[] = { of_find_regulator_gpio, of_find_arizona_gpio, of_find_usb_gpio, + NULL, }; struct gpio_desc *of_find_gpio(struct device *dev, const char *con_id,