linux/drivers/interconnect
Kuan-Wei Chiu f674cb0063 interconnect: debugfs: Fix incorrect error handling for NULL path
[ Upstream commit 6bfe104fd0 ]

The icc_commit_set() function, used by the debugfs interface, checks
the validity of the global cur_path pointer using IS_ERR_OR_NULL().
However, in the specific case where cur_path is NULL, while
IS_ERR_OR_NULL(NULL) correctly evaluates to true, the subsequent call
to PTR_ERR(NULL) returns 0.

This causes the function to return a success code (0) instead of an
error, misleading the user into believing their bandwidth request was
successfully committed when, in fact, no operation was performed.

Fix this by adding an explicit check to return -EINVAL if cur_path is
NULL. This prevents silent failures and ensures that an invalid
operational sequence is immediately and clearly reported as an error.

Fixes: 770c69f037 ("interconnect: Add debugfs test client")
Signed-off-by: Kuan-Wei Chiu <visitorckw@gmail.com>
Link: https://lore.kernel.org/r/20251010151447.2289779-1-visitorckw@gmail.com
Signed-off-by: Georgi Djakov <djakov@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2025-12-18 13:54:51 +01:00
..
imx interconnect: imx: add missing MODULE_DESCRIPTION() macros 2024-06-13 16:12:10 +03:00
mediatek interconnect: mediatek: remove unneeded semicolon 2024-06-24 15:07:25 +03:00
qcom interconnect: qcom: msm8996: add missing link to SLAVE_USB_HS 2025-12-18 13:54:51 +01:00
samsung interconnect: constify of_phandle_args in xlate 2024-02-26 00:38:17 +02:00
bulk.c interconnect: add device managed bulk API 2022-07-04 16:14:29 +03:00
core.c interconnect fixes for v6.9-rc 2024-04-11 14:44:49 +02:00
debugfs-client.c interconnect: debugfs: Fix incorrect error handling for NULL path 2025-12-18 13:54:51 +01:00
icc-clk.c interconnect: icc-clk: Add missed num_nodes initialization 2024-08-23 18:40:00 +03:00
internal.h Merge branch 'icc-debugfs' into icc-next 2023-08-22 21:05:09 +03:00
Kconfig interconnect: mediatek: Add MediaTek MT8183/8195 EMI Interconnect driver 2024-06-13 14:31:43 +03:00
Makefile interconnect: mediatek: Add MediaTek MT8183/8195 EMI Interconnect driver 2024-06-13 14:31:43 +03:00
trace.h tracing/treewide: Remove second parameter of __assign_str() 2024-05-22 20:14:47 -04:00