[PATCH 1/3] bus: imx-aipstz: reject devices without match data
Jiale Yao
yaojiale02 at 163.com
Tue Oct 20 02:36:33 PDT 2026
Platform driver_override can bind a device to this driver without a
matching OF entry. In that case, of_device_get_match_data() returns
NULL and imx_aipstz_apply_default() dereferences it.
Reject devices without match data before applying the default
configuration.
Fixes: 796cba2dd4d9 ("bus: add driver for IMX AIPSTZ bridge")
Cc: stable at vger.kernel.org
Signed-off-by: Jiale Yao <yaojiale02 at 163.com>
---
drivers/bus/imx-aipstz.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/bus/imx-aipstz.c b/drivers/bus/imx-aipstz.c
index 83371e5b35a2..9f74cbcd47ff 100644
--- a/drivers/bus/imx-aipstz.c
+++ b/drivers/bus/imx-aipstz.c
@@ -61,6 +61,8 @@ static int imx_aipstz_probe(struct platform_device *pdev)
"failed to get/ioremap AC memory\n");
data->default_cfg = of_device_get_match_data(&pdev->dev);
+ if (!data->default_cfg)
+ return -ENODATA;
imx_aipstz_apply_default(data);
--
2.34.1
More information about the linux-arm-kernel
mailing list