mirror of
https://github.com/torvalds/linux.git
synced 2026-05-05 23:05:25 -04:00
bcachefs: fix tiny leak in bch2_dev_add()
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
@@ -1811,7 +1811,11 @@ int bch2_dev_add(struct bch_fs *c, const char *path)
|
||||
goto err_late;
|
||||
|
||||
up_write(&c->state_lock);
|
||||
return 0;
|
||||
out:
|
||||
printbuf_exit(&label);
|
||||
printbuf_exit(&errbuf);
|
||||
bch_err_fn(c, ret);
|
||||
return ret;
|
||||
|
||||
err_unlock:
|
||||
mutex_unlock(&c->sb_lock);
|
||||
@@ -1820,10 +1824,7 @@ err:
|
||||
if (ca)
|
||||
bch2_dev_free(ca);
|
||||
bch2_free_super(&sb);
|
||||
printbuf_exit(&label);
|
||||
printbuf_exit(&errbuf);
|
||||
bch_err_fn(c, ret);
|
||||
return ret;
|
||||
goto out;
|
||||
err_late:
|
||||
up_write(&c->state_lock);
|
||||
ca = NULL;
|
||||
|
||||
Reference in New Issue
Block a user