diff options
author | Gustavo A. R. Silva <gustavoars@kernel.org> | 2023-12-18 18:26:26 -0600 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2024-01-01 11:47:41 -0500 |
commit | ac19c4c3d02e19b365209d2cee409671e1fb66bb (patch) | |
tree | dd6d6df1c5fa696c45d20a97ef8df1929fd58647 /fs/bcachefs/chardev.c | |
parent | 038fecc045932171e882a4e3668208c28f66f795 (diff) | |
download | linux-stable-ac19c4c3d02e19b365209d2cee409671e1fb66bb.tar.gz linux-stable-ac19c4c3d02e19b365209d2cee409671e1fb66bb.tar.bz2 linux-stable-ac19c4c3d02e19b365209d2cee409671e1fb66bb.zip |
bcachefs: Use array_size() in call to copy_from_user()
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>
Diffstat (limited to 'fs/bcachefs/chardev.c')
-rw-r--r-- | fs/bcachefs/chardev.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/bcachefs/chardev.c b/fs/bcachefs/chardev.c index 08922f7e380a..295b1f4e9ece 100644 --- 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; } |