summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Horgan <ben.horgan@arm.com>2026-08-06 15:46:30 +0100
committerWill Deacon <will@kernel.org>2026-08-07 11:57:04 +0000
commitfc996c39689bb15aa80e5366809434f7258fb703 (patch)
tree031f2869c756de11853857ce7862e9fa3ad6aef0
parent2c43aced9be353f8428678a75495ca9d631dc927 (diff)
downloadlinux-fc996c39689bb15aa80e5366809434f7258fb703.tar.gz
linux-fc996c39689bb15aa80e5366809434f7258fb703.zip
arm_mpam: Fix a NULL pointer dereference on unbinding after an error interrupt
If a user unbinds an MSC after mpam_disable() has been run in response to an error interrupt then a dereference of a NULL pointer occurs as mpam_disable() sets the drvdata to NULL. Add an early return to the driver remove callback to avoid this. Fixes: f04046f2577a ("arm_mpam: Add probe/remove for mpam msc driver and kbuild boiler plate") Signed-off-by: Ben Horgan <ben.horgan@arm.com> Signed-off-by: Will Deacon <will@kernel.org>
-rw-r--r--drivers/resctrl/mpam_devices.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/resctrl/mpam_devices.c b/drivers/resctrl/mpam_devices.c
index 53942b331269..677ee118d839 100644
--- a/drivers/resctrl/mpam_devices.c
+++ b/drivers/resctrl/mpam_devices.c
@@ -2017,6 +2017,9 @@ static void mpam_msc_drv_remove(struct platform_device *pdev)
{
struct mpam_msc *msc = platform_get_drvdata(pdev);
+ if (!msc)
+ return;
+
mutex_lock(&mpam_list_lock);
mpam_msc_destroy(msc);
mutex_unlock(&mpam_list_lock);