summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJunhao He <hejunhao3@huawei.com>2024-09-18 06:53:27 +0300
committerSuzuki K Poulose <suzuki.poulose@arm.com>2025-04-29 20:47:37 +0300
commit9f52aecc952ddf307571517d5c91136c8c4e87c9 (patch)
treefbc80957ddfde9b1ff1835605a207be3de4c89ef /include
parent9c32cda43eb78f78c73aee4aa344b777714e259b (diff)
downloadlinux-9f52aecc952ddf307571517d5c91136c8c4e87c9.tar.xz
coresight: Fixes device's owner field for registered using coresight_init_driver()
The coresight_init_driver() of the coresight-core module is called from the sub coresgiht device (such as tmc/stm/funnle/...) module. It calls amba_driver_register() and Platform_driver_register(), which are macro functions that use the coresight-core's module to initialize the caller's owner field. Therefore, when the sub coresight device calls coresight_init_driver(), an incorrect THIS_MODULE value is captured. The sub coesgiht modules can be removed while their callbacks are running, resulting in a general protection failure. Add module parameter to coresight_init_driver() so can be called with the module of the callback. Fixes: 075b7cd7ad7d ("coresight: Add helpers registering/removing both AMBA and platform drivers") Signed-off-by: Junhao He <hejunhao3@huawei.com> Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com> Link: https://lore.kernel.org/r/20240918035327.9710-1-hejunhao3@huawei.com
Diffstat (limited to 'include')
-rw-r--r--include/linux/coresight.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/coresight.h b/include/linux/coresight.h
index d79a242b271d..cfcf6e4707ed 100644
--- a/include/linux/coresight.h
+++ b/include/linux/coresight.h
@@ -723,7 +723,7 @@ coresight_find_output_type(struct coresight_platform_data *pdata,
union coresight_dev_subtype subtype);
int coresight_init_driver(const char *drv, struct amba_driver *amba_drv,
- struct platform_driver *pdev_drv);
+ struct platform_driver *pdev_drv, struct module *owner);
void coresight_remove_driver(struct amba_driver *amba_drv,
struct platform_driver *pdev_drv);