diff options
author | Youling Tang <tangyouling@kylinos.cn> | 2024-10-16 09:49:11 +0800 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2024-11-14 16:05:31 -0500 |
commit | 6809a1a61591c3024e55f70311dcb58d3171f1b6 (patch) | |
tree | 87ef0f05ea2ca100210f7c05a8c91edada0f1bc6 | |
parent | 9234637f935a9a798ff111754df2521fc030dcc2 (diff) |
bcachefs: Simplify code in bch2_dev_alloc()
- Remove unnecessary variable 'ret'.
- Remove unnecessary bch2_dev_free() operations.
Signed-off-by: Youling Tang <tangyouling@kylinos.cn>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
-rw-r--r-- | fs/bcachefs/super.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/fs/bcachefs/super.c b/fs/bcachefs/super.c index 7e0ff17a6dbb..ab678231afd4 100644 --- a/fs/bcachefs/super.c +++ b/fs/bcachefs/super.c @@ -1369,7 +1369,6 @@ static int bch2_dev_alloc(struct bch_fs *c, unsigned dev_idx) { struct bch_member member = bch2_sb_member_get(c->disk_sb.sb, dev_idx); struct bch_dev *ca = NULL; - int ret = 0; if (bch2_fs_init_fault("dev_alloc")) goto err; @@ -1381,10 +1380,8 @@ static int bch2_dev_alloc(struct bch_fs *c, unsigned dev_idx) ca->fs = c; bch2_dev_attach(c, ca, dev_idx); - return ret; + return 0; err: - if (ca) - bch2_dev_free(ca); return -BCH_ERR_ENOMEM_dev_alloc; } |