ext4: fix potential integer overflow in alloc_flex_gd()
[linux-2.6.git] / fs / char_dev.c
index 143f020..3f152b9 100644 (file)
@@ -272,7 +272,7 @@ int __register_chrdev(unsigned int major, unsigned int baseminor,
        cd = __register_chrdev_region(major, baseminor, count, name);
        if (IS_ERR(cd))
                return PTR_ERR(cd);
-       
+
        cdev = cdev_alloc();
        if (!cdev)
                goto out2;
@@ -280,7 +280,7 @@ int __register_chrdev(unsigned int major, unsigned int baseminor,
        cdev->owner = fops->owner;
        cdev->ops = fops;
        kobject_set_name(&cdev->kobj, "%s", name);
-               
+
        err = cdev_add(cdev, MKDEV(cd->major, baseminor), count);
        if (err)
                goto out;
@@ -405,7 +405,7 @@ static int chrdev_open(struct inode *inode, struct file *filp)
                goto out_cdev_put;
 
        if (filp->f_op->open) {
-               ret = filp->f_op->open(inode,filp);
+               ret = filp->f_op->open(inode, filp);
                if (ret)
                        goto out_cdev_put;
        }
@@ -417,18 +417,6 @@ static int chrdev_open(struct inode *inode, struct file *filp)
        return ret;
 }
 
-int cdev_index(struct inode *inode)
-{
-       int idx;
-       struct kobject *kobj;
-
-       kobj = kobj_lookup(cdev_map, inode->i_rdev, &idx);
-       if (!kobj)
-               return -1;
-       kobject_put(kobj);
-       return idx;
-}
-
 void cd_forget(struct inode *inode)
 {
        spin_lock(&cdev_lock);
@@ -582,7 +570,6 @@ EXPORT_SYMBOL(cdev_init);
 EXPORT_SYMBOL(cdev_alloc);
 EXPORT_SYMBOL(cdev_del);
 EXPORT_SYMBOL(cdev_add);
-EXPORT_SYMBOL(cdev_index);
 EXPORT_SYMBOL(__register_chrdev);
 EXPORT_SYMBOL(__unregister_chrdev);
 EXPORT_SYMBOL(directly_mappable_cdev_bdi);