[lustre-devel] [PATCH 10/37] lustre: kernelcomm: pass correct gfp_t to kmalloc.

James Simmons jsimmons at infradead.org
Sun Feb 24 09:05:35 PST 2019


> Passing 0 as the gfp_t for kmalloc() is not meaningful, and
> could change behaviour.
> Use an explicit GFP_KERNEL instead.

Why did it every do this ??????

Reviewed-by: James Simmons <jsimmons at infradead.org>
 
> Signed-off-by: NeilBrown <neilb at suse.com>
> ---
>  .../staging/lustre/lustre/obdclass/kernelcomm.c    |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/lustre/lustre/obdclass/kernelcomm.c b/drivers/staging/lustre/lustre/obdclass/kernelcomm.c
> index 925ba52c53b4..09d0b1ab8d1c 100644
> --- a/drivers/staging/lustre/lustre/obdclass/kernelcomm.c
> +++ b/drivers/staging/lustre/lustre/obdclass/kernelcomm.c
> @@ -133,7 +133,7 @@ int libcfs_kkuc_group_add(struct file *filp, int uid, unsigned int group,
>  		return -EBADF;
>  
>  	/* freed in group_rem */
> -	reg = kmalloc(sizeof(*reg) + data_len, 0);
> +	reg = kmalloc(sizeof(*reg) + data_len, GFP_KERNEL);
>  	if (!reg)
>  		return -ENOMEM;
>  
> 
> 
> 


More information about the lustre-devel mailing list