[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <inmlorhcpi5g7kfs45rhtpwq7aatmzxemgnulamvjqxmmmtl2j@vfcd5kndbhep>
Date: Tue, 9 Dec 2025 20:48:13 -0800
From: Dmitry Torokhov <dmitry.torokhov@...il.com>
To: Haotian Zhang <vulab@...as.ac.cn>
Cc: matthias.bgg@...il.com, angelogioacchino.delregno@...labora.com,
louisalexis.eyraud@...labora.com, bisson.gary@...il.com, julien.massot@...labora.com,
linux-input@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-mediatek@...ts.infradead.org
Subject: Re: [PATCH] input: mtk-pmic-keys: Fix potential NULL pointer
dereference in probe()
Hi Haotian,
On Wed, Dec 10, 2025 at 11:00:13AM +0800, Haotian Zhang wrote:
> of_match_device() may return NULL when the device node
> does not match any entry in the driver's match table.
> The current code dereferences of_id->data unconditionally,
> which can lead to a NULL pointer dereference.
How are we getting into probe() without matching compatible?
We already had a discussion about this in [1] and patched the MFD
portion to not use generic driver name when instantiating the keypad
sub-device.
[1] http://lore.kernel.org/r/20250630-mtk-pmic-keys-fix-crash-v1-1-e47351fa9d1f@collabora.com
Thanks.
--
Dmitry
Powered by blists - more mailing lists