From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_2 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8B8D9C48BCF for ; Wed, 9 Jun 2021 11:21:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6AF9B610C7 for ; Wed, 9 Jun 2021 11:21:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233970AbhFILXG (ORCPT ); Wed, 9 Jun 2021 07:23:06 -0400 Received: from gecko.sbs.de ([194.138.37.40]:35422 "EHLO gecko.sbs.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239011AbhFILXG (ORCPT ); Wed, 9 Jun 2021 07:23:06 -0400 X-Greylist: delayed 540 seconds by postgrey-1.27 at vger.kernel.org; Wed, 09 Jun 2021 07:23:05 EDT Received: from mail1.sbs.de (mail1.sbs.de [192.129.41.35]) by gecko.sbs.de (8.15.2/8.15.2) with ESMTPS id 159BBxIE010037 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 9 Jun 2021 13:11:59 +0200 Received: from md1za8fc.ad001.siemens.net ([139.22.32.109]) by mail1.sbs.de (8.15.2/8.15.2) with ESMTP id 159B8Hm0019317; Wed, 9 Jun 2021 13:08:17 +0200 Date: Wed, 9 Jun 2021 13:08:16 +0200 From: Henning Schild To: Andy Shevchenko Cc: Mika Westerberg , Linux Kernel Mailing List , "open list:GPIO SUBSYSTEM" , Andy Shevchenko , Linus Walleij Subject: Re: [PATCH] pinctrl: intel: fix NULL pointer deref Message-ID: <20210609130816.3631f0aa@md1za8fc.ad001.siemens.net> In-Reply-To: References: <20210609062722.9132-1-henning.schild@siemens.com> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Am Wed, 9 Jun 2021 13:33:34 +0300 schrieb Andy Shevchenko : > On Wed, Jun 9, 2021 at 1:12 PM Mika Westerberg > wrote: > > On Wed, Jun 09, 2021 at 08:27:22AM +0200, Henning Schild wrote: > > > match could be NULL in which case we do not go ACPI after all > > ... > > > > adev = ACPI_COMPANION(&pdev->dev); > > > - if (adev) { > > > - const void *match = > > > device_get_match_data(&pdev->dev); - > > > + match = device_get_match_data(&pdev->dev); > > > > Actually we don't even call intel_pinctrl_get_soc_data() if the > > ACPI ID is not listed in the corresponding driver's module table. > > So I don't think match can ever be NULL. > > > > But feel free to prove me wrong ;-) > > It's possible to have bugs in this driver, but can we see the real > case here? Yes that is indeed only showing when using a kernel that has seen other patches. To be precise i applied "[rfc, PATCH v1 0/7] PCI: introduce p2sb helper" before running into the problem. Something in there must be calling the function without the ACPI ID. I am still working on a series of device drivers for Siemens PCs, adding i.e. LEDs which are in fact GPIO. Those PCs have a hidden p2sb and no ACPI entries for the LEDs. In order to use GPIO from the drivers i need to make sure "broxton-pinctrl" comes up even if p2sb is hidden. Long story short, i thought the patch was simple enough to merge even taken out of my special context. Currently intel_pinctl only works if "ps2b is not hidden by BIOS" or "ACPI tables are correct", lifting the ban on the hidden p2sb seems like a useful thing in general (i.e. sysfs gpio interface). And i was hoping Andy would take the lead on that. It is something my Siemens drivers would depend on, but really a generic thing as far as i understand it. regards, Henning