Skip to content

Commit

Permalink
bcachefs: Remove a redundant and harmless bch2_free_super() call
Browse files Browse the repository at this point in the history
Remove a redundant call to bch2_free_super().

This is harmless because bch2_free_super() has a memset() at its end. So
a second call would only lead to from kfree(NULL).

Remove the redundant call and only rely on the error handling path.

Signed-off-by: Christophe JAILLET <[email protected]>
Signed-off-by: Kent Overstreet <[email protected]>
  • Loading branch information
tititiou36 authored and Kent Overstreet committed Oct 22, 2023
1 parent 71933fb commit 0198b23
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion fs/bcachefs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -1605,7 +1605,6 @@ int bch2_dev_add(struct bch_fs *c, const char *path)

ca = __bch2_dev_alloc(c, &dev_mi);
if (!ca) {
bch2_free_super(&sb);
ret = -ENOMEM;
goto err;
}
Expand Down

0 comments on commit 0198b23

Please sign in to comment.