]> Pileus Git - ~andy/linux/blobdiff - block/partition-generic.c
netconf: add the handler to dump entries
[~andy/linux] / block / partition-generic.c
index f1d14519cc040424e79fe0f35f446e4d4e7a123d..789cdea05893bb8e3420ede5d1aa65e7af408e1b 100644 (file)
@@ -249,11 +249,11 @@ void delete_partition(struct gendisk *disk, int partno)
        if (!part)
                return;
 
-       blk_free_devt(part_devt(part));
        rcu_assign_pointer(ptbl->part[partno], NULL);
        rcu_assign_pointer(ptbl->last_lookup, NULL);
        kobject_put(part->holder_dir);
        device_del(part_to_dev(part));
+       blk_free_devt(part_devt(part));
 
        hd_struct_put(part);
 }
@@ -418,7 +418,7 @@ int rescan_partitions(struct gendisk *disk, struct block_device *bdev)
        int p, highest, res;
 rescan:
        if (state && !IS_ERR(state)) {
-               kfree(state);
+               free_partitions(state);
                state = NULL;
        }
 
@@ -525,7 +525,7 @@ rescan:
                        md_autodetect_dev(part_to_dev(part)->devt);
 #endif
        }
-       kfree(state);
+       free_partitions(state);
        return 0;
 }