Skip to content
/ linux Public

Commit 409fe5e

Browse files
Koichiro DenSasha Levin
authored andcommitted
NTB: ntb_transport: Fix too small buffer for debugfs_name
[ Upstream commit 6a4b505 ] The buffer used for "qp%d" was only 4 bytes, which truncates names like "qp10" to "qp1" and causes multiple queues to share the same directory. Enlarge the buffer and use sizeof() to avoid truncation. Fixes: fce8a7b ("PCI-Express Non-Transparent Bridge Support") Cc: <stable@vger.kernel.org> # v3.9+ Reviewed-by: Frank Li <Frank.Li@nxp.com> Reviewed-by: Dave Jiang <dave.jiang@intel.com> Signed-off-by: Koichiro Den <den@valinux.co.jp> Signed-off-by: Jon Mason <jdmason@kudzu.us> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent f521842 commit 409fe5e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/ntb/ntb_transport.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1227,9 +1227,9 @@ static int ntb_transport_init_queue(struct ntb_transport_ctx *nt,
12271227
qp->tx_max_entry = tx_size / qp->tx_max_frame;
12281228

12291229
if (nt->debugfs_node_dir) {
1230-
char debugfs_name[4];
1230+
char debugfs_name[8];
12311231

1232-
snprintf(debugfs_name, 4, "qp%d", qp_num);
1232+
snprintf(debugfs_name, sizeof(debugfs_name), "qp%d", qp_num);
12331233
qp->debugfs_dir = debugfs_create_dir(debugfs_name,
12341234
nt->debugfs_node_dir);
12351235

0 commit comments

Comments
 (0)