diff options
author | Thomas Gleixner <[email protected]> | 2018-06-22 21:20:35 +0200 |
---|---|---|
committer | Thomas Gleixner <[email protected]> | 2018-06-22 21:20:35 +0200 |
commit | 7731b8bc94e599c9a79e428f3359ff2c34b7576a (patch) | |
tree | 879f18ccbe274122f2d4f095b43cbc7f953e0ada /fs/debugfs/file.c | |
parent | 48e315618dc4dc8904182cd221e3d395d5d97005 (diff) | |
parent | 9ffc59d57228d74809700be6f7ecb1db10292f05 (diff) |
Merge branch 'linus' into x86/urgent
Required to queue a dependent fix.
Diffstat (limited to 'fs/debugfs/file.c')
-rw-r--r-- | fs/debugfs/file.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/fs/debugfs/file.c b/fs/debugfs/file.c index 1f99678ff5d3..4fce1da7db23 100644 --- a/fs/debugfs/file.c +++ b/fs/debugfs/file.c @@ -796,19 +796,13 @@ EXPORT_SYMBOL_GPL(debugfs_read_file_bool); ssize_t debugfs_write_file_bool(struct file *file, const char __user *user_buf, size_t count, loff_t *ppos) { - char buf[32]; - size_t buf_size; bool bv; int r; bool *val = file->private_data; struct dentry *dentry = F_DENTRY(file); - buf_size = min(count, (sizeof(buf)-1)); - if (copy_from_user(buf, user_buf, buf_size)) - return -EFAULT; - - buf[buf_size] = '\0'; - if (strtobool(buf, &bv) == 0) { + r = kstrtobool_from_user(user_buf, count, &bv); + if (!r) { r = debugfs_file_get(dentry); if (unlikely(r)) return r; |