diff options
Diffstat (limited to 'fs/partitions')
-rw-r--r-- | fs/partitions/check.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/partitions/check.c b/fs/partitions/check.c index 633f7a0ebb2c..90bcf136a9de 100644 --- a/fs/partitions/check.c +++ b/fs/partitions/check.c | |||
@@ -395,7 +395,7 @@ int add_partition(struct gendisk *disk, int partno, | |||
395 | 395 | ||
396 | err = blk_alloc_devt(p, &devt); | 396 | err = blk_alloc_devt(p, &devt); |
397 | if (err) | 397 | if (err) |
398 | goto out_free; | 398 | goto out_free_stats; |
399 | pdev->devt = devt; | 399 | pdev->devt = devt; |
400 | 400 | ||
401 | /* delay uevent until 'holders' subdir is created */ | 401 | /* delay uevent until 'holders' subdir is created */ |
@@ -426,6 +426,8 @@ int add_partition(struct gendisk *disk, int partno, | |||
426 | 426 | ||
427 | return 0; | 427 | return 0; |
428 | 428 | ||
429 | out_free_stats: | ||
430 | free_part_stats(p); | ||
429 | out_free: | 431 | out_free: |
430 | kfree(p); | 432 | kfree(p); |
431 | return err; | 433 | return err; |