Skip to content

Commit 6a4b505

Browse files
Koichiro Denjonmason
authored andcommitted
NTB: ntb_transport: Fix too small buffer for debugfs_name
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>
1 parent 21fbdc4 commit 6a4b505

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/ntb/ntb_transport.c

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

12541254
if (nt->debugfs_node_dir) {
1255-
char debugfs_name[4];
1255+
char debugfs_name[8];
12561256

1257-
snprintf(debugfs_name, 4, "qp%d", qp_num);
1257+
snprintf(debugfs_name, sizeof(debugfs_name), "qp%d", qp_num);
12581258
qp->debugfs_dir = debugfs_create_dir(debugfs_name,
12591259
nt->debugfs_node_dir);
12601260

0 commit comments

Comments
 (0)