public inbox for linux-bcachefs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] bcachefs: Fix possible pointer dereference
@ 2025-08-06 12:20 Alan Huang
  2025-08-06 14:08 ` Kent Overstreet
  0 siblings, 1 reply; 2+ messages in thread
From: Alan Huang @ 2025-08-06 12:20 UTC (permalink / raw)
  To: kent.overstreet, dan.carpenter; +Cc: linux-bcachefs, Alan Huang

c hasn't been set yet here.

Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Fixes: 09b9c72bd4b7 ("bcachefs: bch_err_throw()")
Signed-off-by: Alan Huang <mmpgouride@gmail.com>
---
 fs/bcachefs/super.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/bcachefs/super.c b/fs/bcachefs/super.c
index b0019488f586..5992ca040bf6 100644
--- a/fs/bcachefs/super.c
+++ b/fs/bcachefs/super.c
@@ -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;
 	}
 
-- 
2.49.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] bcachefs: Fix possible pointer dereference
  2025-08-06 12:20 [PATCH] bcachefs: Fix possible pointer dereference Alan Huang
@ 2025-08-06 14:08 ` Kent Overstreet
  0 siblings, 0 replies; 2+ messages in thread
From: Kent Overstreet @ 2025-08-06 14:08 UTC (permalink / raw)
  To: Alan Huang; +Cc: dan.carpenter, linux-bcachefs

On Wed, Aug 06, 2025 at 08:20:18PM +0800, Alan Huang wrote:
> c hasn't been set yet here.
> 
> Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
> Fixes: 09b9c72bd4b7 ("bcachefs: bch_err_throw()")
> Signed-off-by: Alan Huang <mmpgouride@gmail.com>

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

> ---
>  fs/bcachefs/super.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/bcachefs/super.c b/fs/bcachefs/super.c
> index b0019488f586..5992ca040bf6 100644
> --- a/fs/bcachefs/super.c
> +++ b/fs/bcachefs/super.c
> @@ -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;
>  	}
>  
> -- 
> 2.49.0
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-08-06 14:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-06 12:20 [PATCH] bcachefs: Fix possible pointer dereference Alan Huang
2025-08-06 14:08 ` Kent Overstreet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox