diff options
-rw-r--r-- | fs/bcachefs/super.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/fs/bcachefs/super.c b/fs/bcachefs/super.c index 94e296397e32..9f852a6dd76a 100644 --- a/fs/bcachefs/super.c +++ b/fs/bcachefs/super.c @@ -1613,10 +1613,8 @@ int bch2_dev_add(struct bch_fs *c, const char *path) bch2_dev_usage_init(ca); ret = __bch2_dev_attach_bdev(ca, &sb); - if (ret) { - bch2_dev_free(ca); + if (ret) goto err; - } ret = bch2_dev_journal_alloc(ca); if (ret) { |