Skip to content

Commit 26034b6

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 af45c67 commit 26034b6

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
@@ -1229,9 +1229,9 @@ static int ntb_transport_init_queue(struct ntb_transport_ctx *nt,
12291229
qp->tx_max_entry = tx_size / qp->tx_max_frame;
12301230

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

1234-
snprintf(debugfs_name, 4, "qp%d", qp_num);
1234+
snprintf(debugfs_name, sizeof(debugfs_name), "qp%d", qp_num);
12351235
qp->debugfs_dir = debugfs_create_dir(debugfs_name,
12361236
nt->debugfs_node_dir);
12371237

0 commit comments

Comments
 (0)