]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
md: get_disk_info(): Don't convert between signed and unsigned and back.
authorAndre Noll <maan@systemlinux.org>
Fri, 11 Jul 2008 12:02:21 +0000 (22:02 +1000)
committerNeil Brown <neilb@suse.de>
Fri, 11 Jul 2008 12:02:21 +0000 (22:02 +1000)
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>
drivers/md/md.c

index bd1dc72ae522c87d6f1924141798d7ac732ef1ab..328e247e2bf5d9a3aa9f7c942dc52ed80fb45e8c 100644 (file)
@@ -4186,15 +4186,12 @@ out:
 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);