Re: [PATCH -next] f2fs: Replace kmalloc() with f2fs_kmalloc

From: Jaegeuk Kim
Date: Wed Aug 03 2022 - 23:56:43 EST


On 08/01, studentxswpy@xxxxxxx wrote:
> From: Xie Shaowen <studentxswpy@xxxxxxx>
>
> replace kmalloc with f2fs_kmalloc to keep f2fs code consistency.
>
> Reported-by: Hacash Robot <hacashRobot@xxxxxxxxxxx>
> Signed-off-by: Xie Shaowen <studentxswpy@xxxxxxx>
> ---
> fs/f2fs/dir.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/f2fs/dir.c b/fs/f2fs/dir.c
> index d5bd7932fb64..712b51f69c04 100644
> --- a/fs/f2fs/dir.c
> +++ b/fs/f2fs/dir.c
> @@ -232,7 +232,7 @@ static int f2fs_match_ci_name(const struct inode *dir, const struct qstr *name,
> if (WARN_ON_ONCE(!fscrypt_has_encryption_key(dir)))
> return -EINVAL;
>
> - decrypted_name.name = kmalloc(de_name_len, GFP_KERNEL);
> + decrypted_name.name = f2fs_kmalloc(de_name_len, GFP_KERNEL);

Please fix the build breakage.

fyi;

static inline void *f2fs_kmalloc(struct f2fs_sb_info *sbi, size_t size, gfp_t flags)

> if (!decrypted_name.name)
> return -ENOMEM;
> res = fscrypt_fname_disk_to_usr(dir, 0, 0, &encrypted_name,
> --
> 2.25.1