linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiayu Du <jiayu.riscv@isrc.iscas.ac.cn>
To: linusw@kernel.org
Cc: pjw@kernel.org, palmer@dabbelt.com, aou@eecs.berkeley.edu,
	alex@ghiti.fr, linux-gpio@vger.kernel.org,
	linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org,
	gaohan@iscas.ac.cn, me@ziyao.cc
Subject: Re: [PATCH 1/1] pinctrl: canaan: k230: Fix NULL pointer dereference in device tree parsing
Date: Mon, 29 Dec 2025 00:04:42 +0800	[thread overview]
Message-ID: <aVFVGnU7g6xst7Wo@duge-virtual-machine> (raw)
In-Reply-To: <20251228085005.155760-1-jiayu.riscv@isrc.iscas.ac.cn>

On Sun, Dec 28, 2025 at 04:50:05PM +0800, Jiayu Du wrote:
> When probing the k230 pinctrl driver, the kernel triggers a NULL pointer
> dereference. The crash trace showed:
> [    0.732084] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000068
> [    0.740737] ...
> [    0.776296] epc : k230_pinctrl_probe+0x1be/0x4fc
> 
> In k230_pinctrl_parse_functions(), we attempt to retrieve
> the device pointer via info->pctl_dev->dev, but info->pctl_dev is only
> initialized after k230_pinctrl_parse_dt() completes.
> At the time of DT parsing, info->pctl_dev is still NULL, leading to the invalid
> dereference of info->pctl_dev->dev.
> 
> Use the already available device pointer from platform_device
> instead of accessing through uninitialized pctl_dev.
> 
> Signed-off-by: Jiayu Du <jiayu.riscv@isrc.iscas.ac.cn>
Please ignore this patch. I'm sorry, I forgot to add the "fixes" tag.

I have resubmitted this patch. The link is provided here[1].

[1]: https://lore.kernel.org/all/20251228154947.194684-1-jiayu.riscv@isrc.iscas.ac.cn/


      reply	other threads:[~2025-12-28 16:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-28  8:50 [PATCH 1/1] pinctrl: canaan: k230: Fix NULL pointer dereference in device tree parsing Jiayu Du
2025-12-28 16:04 ` Jiayu Du [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=aVFVGnU7g6xst7Wo@duge-virtual-machine \
    --to=jiayu.riscv@isrc.iscas.ac.cn \
    --cc=alex@ghiti.fr \
    --cc=aou@eecs.berkeley.edu \
    --cc=gaohan@iscas.ac.cn \
    --cc=linusw@kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=me@ziyao.cc \
    --cc=palmer@dabbelt.com \
    --cc=pjw@kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).