diff options
Diffstat (limited to 'drivers/mtd')
-rw-r--r-- | drivers/mtd/ubi/build.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c index 9082768cc6c3..09a326ecd05b 100644 --- a/drivers/mtd/ubi/build.c +++ b/drivers/mtd/ubi/build.c | |||
@@ -380,7 +380,7 @@ static void free_user_volumes(struct ubi_device *ubi) | |||
380 | */ | 380 | */ |
381 | static int uif_init(struct ubi_device *ubi) | 381 | static int uif_init(struct ubi_device *ubi) |
382 | { | 382 | { |
383 | int i, err, do_free = 0; | 383 | int i, err; |
384 | dev_t dev; | 384 | dev_t dev; |
385 | 385 | ||
386 | sprintf(ubi->ubi_name, UBI_NAME_STR "%d", ubi->ubi_num); | 386 | sprintf(ubi->ubi_name, UBI_NAME_STR "%d", ubi->ubi_num); |
@@ -427,13 +427,10 @@ static int uif_init(struct ubi_device *ubi) | |||
427 | 427 | ||
428 | out_volumes: | 428 | out_volumes: |
429 | kill_volumes(ubi); | 429 | kill_volumes(ubi); |
430 | do_free = 0; | ||
431 | out_sysfs: | 430 | out_sysfs: |
432 | ubi_sysfs_close(ubi); | 431 | ubi_sysfs_close(ubi); |
433 | cdev_del(&ubi->cdev); | 432 | cdev_del(&ubi->cdev); |
434 | out_unreg: | 433 | out_unreg: |
435 | if (do_free) | ||
436 | free_user_volumes(ubi); | ||
437 | unregister_chrdev_region(ubi->cdev.dev, ubi->vtbl_slots + 1); | 434 | unregister_chrdev_region(ubi->cdev.dev, ubi->vtbl_slots + 1); |
438 | ubi_err("cannot initialize UBI %s, error %d", ubi->ubi_name, err); | 435 | ubi_err("cannot initialize UBI %s, error %d", ubi->ubi_name, err); |
439 | return err; | 436 | return err; |