Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp4042529rwb; Tue, 20 Sep 2022 08:05:14 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5TujMuIZO14M7oFYn8v6tK0EeIRuQnQc58pjEmSIXxZUWXOmoyRePyFmRsptc8RBBJZvIm X-Received: by 2002:a17:906:8448:b0:77b:e6d0:58a5 with SMTP id e8-20020a170906844800b0077be6d058a5mr17862779ejy.347.1663686313980; Tue, 20 Sep 2022 08:05:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663686313; cv=none; d=google.com; s=arc-20160816; b=mOcMGi0Tqv68c86Z8WKBkdlMgcMIP9RV0v/s+U3g29KNcnaoldJ4XPA8aBfcjXpkxZ QQdkRYJw14EvTRg88jsYzeZFt3zpFbPt+vJ8DjgAB3aRjxYrznYUA/4xSS/jqIju80eR swgInSBSr2n5pVoJZlBao2rWpMuFm2ArUDs/mI1lFxhJbkm3Tc/IhwRgFo3pXqojng+m igLdMN/vngMAeCM772oIaLQJjSMoICRKPbu4+FHVxZ94JoiESWnnGSgXLC+j93hcJfZd rBvSi30NQMFUS5P3u6FBiwvIVyX6Bmo/e6N03CYwNbPsFKa2DAZt7VEeJhQqUUjF19DQ gEsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=Liib93EzAVK4sIXWmleEPgo27rMYZRDPIdCFkLHuB5M=; b=dx7fRuVQvQDGO0Fue1/VDbQe7k0HJREimG+Jz0Hgb0tzJ1aeH6gWUuIeqUaU+Z559J 9MSmUALd6y+FzQByjvMNQWOcyaGmPqcrtK3W1QwgJbofk58CUJn3j2z6EqaOJt9illH0 RZY/Y0x/VW4HfRmcpzea0q89oKFnTzQzGwEPcyjQ1yE4EqYd/xLrgu+guofTe9s+QekA IIhggnZPplM+KM7r+NIX5OPlfACUFRIIk8w/PXuBZqrr1wiWdlSmPNUcqjW+vmdyILg5 /WGF3KPVi80laQqe4DvP0JegK+hf0qfc9a5sGg02ucLQOSdCiX0IqmdKSQEE5jqjhjKa 4Aeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=dMG2QRyt; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r16-20020aa7da10000000b004533149e228si186323eds.618.2022.09.20.08.04.45; Tue, 20 Sep 2022 08:05:13 -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=@gmail.com header.s=20210112 header.b=dMG2QRyt; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230319AbiITO1s (ORCPT + 99 others); Tue, 20 Sep 2022 10:27:48 -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-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 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 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, -- 2.37.3