From nobody Sun Feb 8 06:54:37 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B219B1A01C6; Fri, 9 Jan 2026 12:25:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767961553; cv=none; b=tPptZjkRIaF5vkS61adZpAGWA1Ctmc5SmZBR/Q3Y7Uf9P/6i3am981XQLWIEopo6hwVcAqM6Tl2IyN6z8HUSXLXeuJY4hhN7AEuKkbjgz0K68taYx5V3rwJXt4kx5hZiWb7q0RH2xdhtvJTKu+EsytWOJBbqTQycUsxTtUMDVBw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767961553; c=relaxed/simple; bh=mqfMweubTjwC6/K1g05RuytgLKSPH1AqfDM8zhFG41Y=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=sWqwAw76n4IekEE8ey4i9Hc59AKT3lZti8QYJ0A7tPGlPyTNz6f66pt6mZCdV93g+z0fuzXgSctqGffLYbscFMmP+YtEY7apVGu1GkG+ybrho75oVl9HqLAw77mMTvP/IqyEv8Ua4X9cQzkpT7tSKwGp0jWegSpvd/wc/UplOiA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=e8eoq/hf; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="e8eoq/hf" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 532B5C4CEF1; Fri, 9 Jan 2026 12:25:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1767961553; bh=mqfMweubTjwC6/K1g05RuytgLKSPH1AqfDM8zhFG41Y=; h=From:To:Cc:Subject:Date:From; b=e8eoq/hf9kDwJ7heyHx4JD2P+LlvyRjcXzBVKyUmsM4YbvLVyF3o+qkEJZ3Y6O8BQ lTXkypix9VhR8wyaLLW8vbVGpQ4eretrpbjbfsM8nxNAS/VPxXEMAHzQCSdoWqNYBL WnIPyV7IZQyWeHzcxCX6TroUehOaJI52csFCnCYmSRpgjJOTEGmg5t7hAIk6yHKcWz hdiVk9YdwIG/Pca0X7PcifAroWx7nFdlg0GeGFIV/FP7bF49zIcqX/H+uTNgBjt+ok n1kNIHb5GXcxTbeerx9EcjgGOBIoUruQ6Gx3lxRm0HP0v1jI4lixSZt5ktrovkymv/ EEPoq7bYUivSg== From: djakov@kernel.org To: djakov@kernel.org, quic_mdtipton@quicinc.com Cc: mike.tipton@oss.qualcomm.com, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] interconnect: debugfs: initialize src_node and dst_node to empty strings Date: Fri, 9 Jan 2026 14:25:23 +0200 Message-Id: <20260109122523.125843-1-djakov@kernel.org> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Georgi Djakov The debugfs_create_str() API assumes that the string pointer is either NULL or points to valid kmalloc() memory. Leaving the pointer uninitialized can cause problems. Initialize src_node and dst_node to empty strings before creating the debugfs entries to guarantee that reads and writes are safe. Fixes: 770c69f037c1 ("interconnect: Add debugfs test client") Signed-off-by: Georgi Djakov Reviewed-by: Kuan-Wei Chiu Tested-by: Kuan-Wei Chiu --- drivers/interconnect/debugfs-client.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/interconnect/debugfs-client.c b/drivers/interconnect/d= ebugfs-client.c index 778deeb4a7e8..24d7b5a57794 100644 --- a/drivers/interconnect/debugfs-client.c +++ b/drivers/interconnect/debugfs-client.c @@ -150,6 +150,11 @@ int icc_debugfs_client_init(struct dentry *icc_dir) return ret; } =20 + src_node =3D devm_kstrdup(&pdev->dev, "", GFP_KERNEL); + dst_node =3D devm_kstrdup(&pdev->dev, "", GFP_KERNEL); + if (!src_node || !dst_node) + return -ENOMEM; + client_dir =3D debugfs_create_dir("test_client", icc_dir); =20 debugfs_create_str("src_node", 0600, client_dir, &src_node);