diff options
| author | Li Jun <lijun01@kylinos.cn> | 2026-06-02 18:31:20 +0800 |
|---|---|---|
| committer | Georgi Djakov <djakov@kernel.org> | 2026-07-22 12:36:47 +0300 |
| commit | ecf20a5e15f9c81a97b1249c979b9c439e777592 (patch) | |
| tree | 13acfaa0e466c2fb7f0e874220860f37a846c318 /drivers/interconnect | |
| parent | bd8a131fbe4989b8e57aa74fdc974900460ac387 (diff) | |
| download | linux-next-ecf20a5e15f9c81a97b1249c979b9c439e777592.tar.gz linux-next-ecf20a5e15f9c81a97b1249c979b9c439e777592.zip | |
interconnect: debugfs-client: add NULL check for platform_device_alloc
platform_device_alloc() may return NULL when memory allocation fails.
Add proper error handling to prevent a potential NULL pointer
dereference when calling platform_device_add() with a NULL pointer.
Signed-off-by: Li Jun <lijun01@kylinos.cn>
Link: https://patch.msgid.link/20260602103120.2966458-1-lijun01@kylinos.cn
Signed-off-by: Georgi Djakov <djakov@kernel.org>
Diffstat (limited to 'drivers/interconnect')
| -rw-r--r-- | drivers/interconnect/debugfs-client.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/interconnect/debugfs-client.c b/drivers/interconnect/debugfs-client.c index 08df9188ef94..91f86d9237a6 100644 --- a/drivers/interconnect/debugfs-client.c +++ b/drivers/interconnect/debugfs-client.c @@ -142,6 +142,8 @@ int icc_debugfs_client_init(struct dentry *icc_dir) int ret; pdev = platform_device_alloc("icc-debugfs-client", PLATFORM_DEVID_NONE); + if (!pdev) + return -ENOMEM; ret = platform_device_add(pdev); if (ret) { |
