diff options
Diffstat (limited to 'fs/btrfs/super.c')
-rw-r--r-- | fs/btrfs/super.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index b2130c46fdb5..a004008f7d28 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c | |||
@@ -383,7 +383,7 @@ static int btrfs_parse_early_options(const char *options, fmode_t flags, | |||
383 | struct btrfs_fs_devices **fs_devices) | 383 | struct btrfs_fs_devices **fs_devices) |
384 | { | 384 | { |
385 | substring_t args[MAX_OPT_ARGS]; | 385 | substring_t args[MAX_OPT_ARGS]; |
386 | char *opts, *p; | 386 | char *opts, *orig, *p; |
387 | int error = 0; | 387 | int error = 0; |
388 | int intarg; | 388 | int intarg; |
389 | 389 | ||
@@ -397,6 +397,7 @@ static int btrfs_parse_early_options(const char *options, fmode_t flags, | |||
397 | opts = kstrdup(options, GFP_KERNEL); | 397 | opts = kstrdup(options, GFP_KERNEL); |
398 | if (!opts) | 398 | if (!opts) |
399 | return -ENOMEM; | 399 | return -ENOMEM; |
400 | orig = opts; | ||
400 | 401 | ||
401 | while ((p = strsep(&opts, ",")) != NULL) { | 402 | while ((p = strsep(&opts, ",")) != NULL) { |
402 | int token; | 403 | int token; |
@@ -432,7 +433,7 @@ static int btrfs_parse_early_options(const char *options, fmode_t flags, | |||
432 | } | 433 | } |
433 | 434 | ||
434 | out_free_opts: | 435 | out_free_opts: |
435 | kfree(opts); | 436 | kfree(orig); |
436 | out: | 437 | out: |
437 | /* | 438 | /* |
438 | * If no subvolume name is specified we use the default one. Allocate | 439 | * If no subvolume name is specified we use the default one. Allocate |
@@ -623,6 +624,8 @@ int btrfs_sync_fs(struct super_block *sb, int wait) | |||
623 | btrfs_wait_ordered_extents(root, 0, 0); | 624 | btrfs_wait_ordered_extents(root, 0, 0); |
624 | 625 | ||
625 | trans = btrfs_start_transaction(root, 0); | 626 | trans = btrfs_start_transaction(root, 0); |
627 | if (IS_ERR(trans)) | ||
628 | return PTR_ERR(trans); | ||
626 | ret = btrfs_commit_transaction(trans, root); | 629 | ret = btrfs_commit_transaction(trans, root); |
627 | return ret; | 630 | return ret; |
628 | } | 631 | } |
@@ -761,6 +764,8 @@ static struct dentry *btrfs_mount(struct file_system_type *fs_type, int flags, | |||
761 | } | 764 | } |
762 | 765 | ||
763 | btrfs_close_devices(fs_devices); | 766 | btrfs_close_devices(fs_devices); |
767 | kfree(fs_info); | ||
768 | kfree(tree_root); | ||
764 | } else { | 769 | } else { |
765 | char b[BDEVNAME_SIZE]; | 770 | char b[BDEVNAME_SIZE]; |
766 | 771 | ||