Commit 26ef379f authored by Andre Noll's avatar Andre Noll Committed by Neil Brown

md: get_disk_info(): Don't convert between signed and unsigned and back.

The current code copies a signed int from user space, converts it to
unsigned and passes the unsigned value to find_rdev_nr() which expects
a signed value. Simply pass the signed value from user space directly.
Signed-off-by: default avatarAndre Noll <maan@systemlinux.org>
Signed-off-by: default avatarNeil Brown <neilb@suse.de>
parent 80fab1d7
......@@ -4186,15 +4186,12 @@ static int get_bitmap_file(mddev_t * mddev, void __user * arg)
static int get_disk_info(mddev_t * mddev, void __user * arg)
{
mdu_disk_info_t info;
unsigned int nr;
mdk_rdev_t *rdev;
if (copy_from_user(&info, arg, sizeof(info)))
return -EFAULT;
nr = info.number;
rdev = find_rdev_nr(mddev, nr);
rdev = find_rdev_nr(mddev, info.number);
if (rdev) {
info.major = MAJOR(rdev->bdev->bd_dev);
info.minor = MINOR(rdev->bdev->bd_dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment