Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: fce8a7bb5b4b ("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>

authored by

Koichiro Den and committed by
Jon Mason
6a4b5058 21fbdc4d

+2 -2
+2 -2
drivers/ntb/ntb_transport.c
··· 1252 1252 qp->tx_max_entry = tx_size / qp->tx_max_frame; 1253 1253 1254 1254 if (nt->debugfs_node_dir) { 1255 - char debugfs_name[4]; 1255 + char debugfs_name[8]; 1256 1256 1257 - snprintf(debugfs_name, 4, "qp%d", qp_num); 1257 + snprintf(debugfs_name, sizeof(debugfs_name), "qp%d", qp_num); 1258 1258 qp->debugfs_dir = debugfs_create_dir(debugfs_name, 1259 1259 nt->debugfs_node_dir); 1260 1260