lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sat, 24 Sep 2022 14:41:26 -0700
From:   Joe Perches <joe@...ches.com>
To:     liujing <liujing@...s.chinamobile.com>, vgoyal@...hat.com
Cc:     stefanha@...hat.com, miklos@...redi.hu,
        linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] virtio_fs.c: add check kmalloc return

On Sat, 2022-09-24 at 10:17 -0400, liujing wrote:
> Signed-off-by: liujing <liujing@...s.chinamobile.com>

Generally it's better to have a commit message

> diff --git a/fs/fuse/virtio_fs.c b/fs/fuse/virtio_fs.c
[]
> @@ -989,6 +989,10 @@ __releases(fiq->lock)
>  
>  	/* Allocate a buffer for the request */
>  	forget = kmalloc(sizeof(*forget), GFP_NOFS | __GFP_NOFAIL);
> +

A blank line is not typically used here.

> +	if (forget == NULL)
> +		return -ENOMEM;

And this is unnecessary as __GFP_NOFAIL will do what it says.

include/linux/gfp_types.h:

 * %__GFP_NOFAIL: The VM implementation _must_ retry infinitely: the caller
 * cannot handle allocation failures. The allocation could block
 * indefinitely but will never return with failure. Testing for
 * failure is pointless.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ