From: Helge Deller <deller@gmx.de>
To: Haotian Zhang <vulab@iscas.ac.cn>, Antonino Daplas <adaplas@gmail.com>
Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] fbdev/riva: Add NULL checks for pci_get_domain_bus_and_slot()
Date: Fri, 14 Nov 2025 20:15:58 +0100 [thread overview]
Message-ID: <395da01a-a441-4ee5-a49c-e385f800c627@gmx.de> (raw)
In-Reply-To: <20251114080634.2342-1-vulab@iscas.ac.cn>
On 11/14/25 09:06, Haotian Zhang wrote:
> The pci_get_domain_bus_and_slot() function can return NULL
> if the requested PCI device is not found. The
> nForceUpdateArbitrationSettings() and nv10GetConfig()
> do not check for this, which can lead to a NULL pointer dereference
> when the returned pointer is used in pci_read_config_dword().
>
> Add NULL checks immediately after the calls to
> pci_get_domain_bus_and_slot() in both functions.
You issue a warning if the device isn't found (which seems
unlikely btw.).
But you don't take care that the driver exits cleanly then.
Instead it will still try to configure and use rivafb which is wrong.
Helge
prev parent reply other threads:[~2025-11-14 19:16 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-14 8:06 [PATCH] fbdev/riva: Add NULL checks for pci_get_domain_bus_and_slot() Haotian Zhang
2025-11-14 19:15 ` Helge Deller [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=395da01a-a441-4ee5-a49c-e385f800c627@gmx.de \
--to=deller@gmx.de \
--cc=adaplas@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=vulab@iscas.ac.cn \
/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