projects
/
linux-block.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
038fecc
)
bcachefs: Use array_size() in call to copy_from_user()
author
Gustavo A. R. Silva
<gustavoars@kernel.org>
Tue, 19 Dec 2023 00:26:26 +0000
(18:26 -0600)
committer
Kent Overstreet
<kent.overstreet@linux.dev>
Mon, 1 Jan 2024 16:47:41 +0000
(11:47 -0500)
Use array_size() helper, instead of the open-coded version in
call to copy_from_user().
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/chardev.c
patch
|
blob
|
blame
|
history
diff --git
a/fs/bcachefs/chardev.c
b/fs/bcachefs/chardev.c
index 08922f7e380a9920fc1377ee1fd1e53dcaadb058..295b1f4e9ece805c62ea1630b89d41a5108268bf 100644
(file)
--- a/
fs/bcachefs/chardev.c
+++ b/
fs/bcachefs/chardev.c
@@
-360,7
+360,8
@@
static long bch2_ioctl_fsck_offline(struct bch_ioctl_fsck_offline __user *user_a
init_waitqueue_head(&thr->output.wait);
darray_init(&thr->output2);
- if (copy_from_user(devs, &user_arg->devs[0], sizeof(user_arg->devs[0]) * arg.nr_devs)) {
+ if (copy_from_user(devs, &user_arg->devs[0],
+ array_size(sizeof(user_arg->devs[0]), arg.nr_devs))) {
ret = -EINVAL;
goto err;
}