Skip to content

Commit 912e128

Browse files
lsgunthjonmason
authored andcommitted
NTB: ntb_tool: reading the link file should not end in a NULL byte
When running ntb_test this warning is issued: ./ntb_test.sh: line 200: warning: command substitution: ignored null byte in input This is caused by the kernel returning one more byte than is necessary when reading the link file. Reduce the number of bytes read back to 2 as it was before the commit that regressed this. Fixes: 7f46c8b ("NTB: ntb_tool: Add full multi-port NTB API support") Signed-off-by: Logan Gunthorpe <logang@deltatee.com> Acked-by: Allen Hubbe <allenbh@gmail.com> Tested-by: Alexander Fomichev <fomichev.ru@gmail.com> Signed-off-by: Jon Mason <jdmason@kudzu.us>
1 parent 9cb8bfd commit 912e128

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

‎drivers/ntb/test/ntb_tool.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ static ssize_t tool_peer_link_read(struct file *filep, char __user *ubuf,
504504
buf[1] = '\n';
505505
buf[2] = '\0';
506506

507-
return simple_read_from_buffer(ubuf, size, offp, buf, 3);
507+
return simple_read_from_buffer(ubuf, size, offp, buf, 2);
508508
}
509509

510510
static TOOL_FOPS_RDWR(tool_peer_link_fops,
@@ -1690,4 +1690,3 @@ static void __exit tool_exit(void)
16901690
debugfs_remove_recursive(tool_dbgfs_topdir);
16911691
}
16921692
module_exit(tool_exit);
1693-

0 commit comments

Comments
 (0)