Skip to contentSkip to conversation

bcachefs: Fix possible pointer dereference

PATCH In review Alan Huang 2 participants 2 messages Aug 6, 2025

lore
Share & tools
lore

Alan Huang

author
#0 lore raw

PATCH 1/1 bcachefs: Fix possible pointer dereference

c hasn't been set yet here.

Fixes 09b9c72bd4b7 ("bcachefs: bch_err_throw()")
---
 fs/bcachefs/super.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/bcachefs/super.c +1 -1
index b0019488f586..5992ca040bf6 100644
@@ -2369,7 +2369,7 @@ struct bch_fs *bch2_fs_open(darray_const_str *devices,
 	}
 
 	if (opts->nochanges && !opts->read_only) {
-		ret = bch_err_throw(c, erofs_nochanges);
+		ret = -BCH_ERR_erofs_nochanges;
 		goto err_print;
 	}
 
Signature · 1 line
2.49.0
#1 lore raw
Quoted 5 lines · Alan Huang

c hasn't been set yet here.

Fixes 09b9c72bd4b7 ("bcachefs: bch_err_throw()")

Beat you to it, I fixed this one yesterday :)

Quoted 20 lines
---
 fs/bcachefs/super.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/bcachefs/super.c +1 -1
index b0019488f586..5992ca040bf6 100644
@@ -2369,7 +2369,7 @@ struct bch_fs *bch2_fs_open(darray_const_str *devices,
 	}
 
 	if (opts->nochanges && !opts->read_only) {
-		ret = bch_err_throw(c, erofs_nochanges);
+		ret = -BCH_ERR_erofs_nochanges;
 		goto err_print;
 	}
 
Signature · 1 line
2.49.0