aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/md.c
diff options
context:
space:
mode:
authorAndre Noll <maan@systemlinux.org>2008-07-11 08:02:21 -0400
committerNeil Brown <neilb@suse.de>2008-07-11 08:02:21 -0400
commit26ef379f53993b1da3c19b63257cd47e1d9cd672 (patch)
treec02f2acfb14c6b8294e101f53fb10a9d978844bb /drivers/md/md.c
parent80fab1d77b2852711917baa437e4fdab31c21fef (diff)
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: Andre Noll <maan@systemlinux.org> Signed-off-by: Neil Brown <neilb@suse.de>
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r--drivers/md/md.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index bd1dc72ae522..328e247e2bf5 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -4186,15 +4186,12 @@ out:
4186static int get_disk_info(mddev_t * mddev, void __user * arg) 4186static int get_disk_info(mddev_t * mddev, void __user * arg)
4187{ 4187{
4188 mdu_disk_info_t info; 4188 mdu_disk_info_t info;
4189 unsigned int nr;
4190 mdk_rdev_t *rdev; 4189 mdk_rdev_t *rdev;
4191 4190
4192 if (copy_from_user(&info, arg, sizeof(info))) 4191 if (copy_from_user(&info, arg, sizeof(info)))
4193 return -EFAULT; 4192 return -EFAULT;
4194 4193
4195 nr = info.number; 4194 rdev = find_rdev_nr(mddev, info.number);
4196
4197 rdev = find_rdev_nr(mddev, nr);
4198 if (rdev) { 4195 if (rdev) {
4199 info.major = MAJOR(rdev->bdev->bd_dev); 4196 info.major = MAJOR(rdev->bdev->bd_dev);
4200 info.minor = MINOR(rdev->bdev->bd_dev); 4197 info.minor = MINOR(rdev->bdev->bd_dev);