mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-09 06:41:06 -04:00
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>
This commit is contained in:
committed by
Kent Overstreet
parent
038fecc045
commit
ac19c4c3d0
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user