On Wed, Apr 02, 2025 at 09:22:56AM -0700, Eric Biggers wrote:
> From: Eric Biggers <[email protected]>
>
> The 'key' local variable is no longer used, now that the key is being
> written directly to the struct bch_fs.
>
> Signed-off-by: Eric Biggers <[email protected]>
Applied
> ---
>
> Please feel free to fold this into
> "bcachefs: use library APIs for ChaCha20 and Poly1305".
>
> fs/bcachefs/checksum.c | 11 ++++-------
> 1 file changed, 4 insertions(+), 7 deletions(-)
>
> diff --git a/fs/bcachefs/checksum.c b/fs/bcachefs/checksum.c
> index 7d1e3b908eecd..d0a34a097b809 100644
> --- a/fs/bcachefs/checksum.c
> +++ b/fs/bcachefs/checksum.c
> @@ -682,20 +682,17 @@ void bch2_fs_encryption_exit(struct bch_fs *c)
> }
>
> int bch2_fs_encryption_init(struct bch_fs *c)
> {
> struct bch_sb_field_crypt *crypt;
> - struct bch_key key;
> - int ret = 0;
> + int ret;
>
> crypt = bch2_sb_field_get(c->disk_sb.sb, crypt);
> if (!crypt)
> - goto out;
> + return 0;
>
> ret = bch2_decrypt_sb_key(c, crypt, &c->chacha20_key);
> if (ret)
> - goto out;
> + return ret;
> c->chacha20_key_set = true;
> -out:
> - memzero_explicit(&key, sizeof(key));
> - return ret;
> + return 0;
> }
>
> base-commit: 04c4768d24f70d457ff49681ef726d5d23c089a5
> --
> 2.49.0
>