mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Val Packett <val@packett.cool>
To: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>,
	Linus Walleij <linusw@kernel.org>,
	Bartosz Golaszewski <brgl@kernel.org>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Konrad Dybcio <konradybcio@kernel.org>
Cc: linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org
Subject: Re: [PATCH] gpiolib: fix lookup table matching
Date: Fri, 9 Jan 2026 01:42:43 -0300	[thread overview]
Message-ID: <2dc9a9a3-2af7-475d-bfb6-9741ac0f2790@packett.cool> (raw)
In-Reply-To: <20260108102314.18816-1-bartosz.golaszewski@oss.qualcomm.com>

On 1/8/26 7:23 AM, Bartosz Golaszewski wrote:

> If on any iteration in gpiod_find(), gpio_desc_table_match() returns
> NULL (which is normal and expected), we never reinitialize desc back to
> ERR_PTR(-ENOENT) and if we don't find a match later on, we will return
> NULL causing a NULL-pointer dereference in users not expecting it. Don't
> initialize desc, but return ERR_PTR(-ENOENT) explicitly at the end of
> the function.
>
> Fixes: 9700b0fccf38 ("gpiolib: allow multiple lookup tables per consumer")
> Reported-by: Marek Szyprowski <m.szyprowski@samsung.com>
> Closes: https://lore.kernel.org/all/00107523-7737-4b92-a785-14ce4e93b8cb@samsung.com/
> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>


Tested-by: Val Packett <val@packett.cool>

This also fixes things on Qualcomm x1e laptops (same NULL deref logged 
from snd_soc_wcd938x wcd938x_probe, but as a consequence the display&gpu 
subsystem also wouldn't work)


      parent reply	other threads:[~2026-01-09  4:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20260108102327eucas1p1441a46ec3d1be1e9eaee611959014de3@eucas1p1.samsung.com>
2026-01-08 10:23 ` Bartosz Golaszewski
2026-01-08 10:31   ` Marek Szyprowski
2026-01-08 14:23   ` Bartosz Golaszewski
2026-01-09  4:42   ` Val Packett [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2dc9a9a3-2af7-475d-bfb6-9741ac0f2790@packett.cool \
    --to=val@packett.cool \
    --cc=bartosz.golaszewski@oss.qualcomm.com \
    --cc=brgl@kernel.org \
    --cc=konradybcio@kernel.org \
    --cc=linusw@kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®