]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
platform/x86/intel/pmt/discovery: use valid device pointer in dev_err_probe
authorAlok Tiwari <alok.a.tiwari@oracle.com>
Wed, 24 Dec 2025 09:51:09 +0000 (01:51 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 8 Jan 2026 09:16:48 +0000 (10:16 +0100)
commit7f18ebf8c455f9b51a2e58c62f98310357069ada
tree0d29b50c9c834d8b6ab28ae98875a1d19ad617c7
parent79cab730dbaaac03b946c7f5681bd08c986e2abd
platform/x86/intel/pmt/discovery: use valid device pointer in dev_err_probe

[ Upstream commit 66e245db16f0175af656cd812b6dc1a5e1f7b80a ]

The PMT feature probe creates a child device with device_create().
If device creation fail, the code pass priv->dev (which is an ERR_PTR)
to dev_err_probe(), which is not a valid device pointer.

This patch change the dev_err_probe() call to use the parent auxiliary
device (&auxdev->dev) and update the error message to reference the
parent device name. It ensure correct error reporting and avoid
passing an invalid device pointer.

Fixes: d9a078809356 ("platform/x86/intel/pmt: Add PMT Discovery driver")
Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com>
Link: https://patch.msgid.link/20251224095133.115678-1-alok.a.tiwari@oracle.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/platform/x86/intel/pmt/discovery.c