提交 912e1281 编写于 作者: L Logan Gunthorpe 提交者: Jon Mason

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: 7f46c8b3 ("NTB: ntb_tool: Add full multi-port NTB API support")
Signed-off-by: NLogan Gunthorpe <logang@deltatee.com>
Acked-by: NAllen Hubbe <allenbh@gmail.com>
Tested-by: NAlexander Fomichev <fomichev.ru@gmail.com>
Signed-off-by: NJon Mason <jdmason@kudzu.us>
上级 9cb8bfdf
...@@ -504,7 +504,7 @@ static ssize_t tool_peer_link_read(struct file *filep, char __user *ubuf, ...@@ -504,7 +504,7 @@ static ssize_t tool_peer_link_read(struct file *filep, char __user *ubuf,
buf[1] = '\n'; buf[1] = '\n';
buf[2] = '\0'; buf[2] = '\0';
return simple_read_from_buffer(ubuf, size, offp, buf, 3); return simple_read_from_buffer(ubuf, size, offp, buf, 2);
} }
static TOOL_FOPS_RDWR(tool_peer_link_fops, static TOOL_FOPS_RDWR(tool_peer_link_fops,
...@@ -1690,4 +1690,3 @@ static void __exit tool_exit(void) ...@@ -1690,4 +1690,3 @@ static void __exit tool_exit(void)
debugfs_remove_recursive(tool_dbgfs_topdir); debugfs_remove_recursive(tool_dbgfs_topdir);
} }
module_exit(tool_exit); module_exit(tool_exit);
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册