projects
/
platform
/
kernel
/
linux-starfive.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
72a91f1
)
debugfs: drop pointless nul-termination in debugfs_read_file_bool()
author
Rasmus Villemoes
<linux@rasmusvillemoes.dk>
Fri, 26 Mar 2021 15:14:11 +0000
(16:14 +0100)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Mon, 5 Apr 2021 11:17:51 +0000
(13:17 +0200)
simple_read_from_buffer() doesn't care about any bytes in the buffer
beyond "available". Making the buffer nul-terminated is therefore
completely pointless.
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Link:
https://lore.kernel.org/r/20210326151411.732220-1-linux@rasmusvillemoes.dk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/debugfs/file.c
patch
|
blob
|
history
diff --git
a/fs/debugfs/file.c
b/fs/debugfs/file.c
index 686e0ad287880c15406a479a3acc209a8fa1396f..9979d981e9beb8f8ad8b84e6a08feaee43c0e786 100644
(file)
--- a/
fs/debugfs/file.c
+++ b/
fs/debugfs/file.c
@@
-773,7
+773,7
@@
EXPORT_SYMBOL_GPL(debugfs_create_atomic_t);
ssize_t debugfs_read_file_bool(struct file *file, char __user *user_buf,
size_t count, loff_t *ppos)
{
- char buf[
3
];
+ char buf[
2
];
bool val;
int r;
struct dentry *dentry = F_DENTRY(file);
@@
-789,7
+789,6
@@
ssize_t debugfs_read_file_bool(struct file *file, char __user *user_buf,
else
buf[0] = 'N';
buf[1] = '\n';
- buf[2] = 0x00;
return simple_read_from_buffer(user_buf, count, ppos, buf, 2);
}
EXPORT_SYMBOL_GPL(debugfs_read_file_bool);