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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <12710794.bZoXGNj3NF@avalon>
Date:   Tue, 11 Sep 2018 18:07:52 +0300
From:   Laurent Pinchart <laurent.pinchart@...asonboard.com>
To:     Gerd Hoffmann <kraxel@...hat.com>
Cc:     dri-devel@...ts.freedesktop.org, daniel@...ll.ch,
        Sumit Semwal <sumit.semwal@...aro.org>,
        "open list:DMA BUFFER SHARING FRAMEWORK" 
        <linux-media@...r.kernel.org>,
        "moderated list:DMA BUFFER SHARING FRAMEWORK" 
        <linaro-mm-sig@...ts.linaro.org>,
        open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 12/13] udmabuf: use sizeof(variable) instead of sizeof(type)

Hi Gerd,

Thank you for the patch.

On Tuesday, 11 September 2018 16:42:15 EEST Gerd Hoffmann wrote:
> Reported-by: Laurent Pinchart <laurent.pinchart@...asonboard.com>
> Signed-off-by: Gerd Hoffmann <kraxel@...hat.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart@...asonboard.com>

> ---
>  drivers/dma-buf/udmabuf.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/dma-buf/udmabuf.c b/drivers/dma-buf/udmabuf.c
> index 7a4fd2194d..92af9b5300 100644
> --- a/drivers/dma-buf/udmabuf.c
> +++ b/drivers/dma-buf/udmabuf.c
> @@ -128,7 +128,7 @@ static long udmabuf_create(const struct
> udmabuf_create_list *head, int seals, ret = -EINVAL;
>  	u32 i, flags;
> 
> -	ubuf = kzalloc(sizeof(struct udmabuf), GFP_KERNEL);
> +	ubuf = kzalloc(sizeof(*ubuf), GFP_KERNEL);
>  	if (!ubuf)
>  		return -ENOMEM;
> 
> @@ -142,7 +142,7 @@ static long udmabuf_create(const struct
> udmabuf_create_list *head, if (ubuf->pagecount > pglimit)
>  			goto err;
>  	}
> -	ubuf->pages = kmalloc_array(ubuf->pagecount, sizeof(struct page *),
> +	ubuf->pages = kmalloc_array(ubuf->pagecount, sizeof(*ubuf->pages),
>  				    GFP_KERNEL);
>  	if (!ubuf->pages) {
>  		ret = -ENOMEM;
> @@ -211,7 +211,7 @@ static long udmabuf_ioctl_create(struct file *filp,
> unsigned long arg) struct udmabuf_create_item list;
> 
>  	if (copy_from_user(&create, (void __user *)arg,
> -			   sizeof(struct udmabuf_create)))
> +			   sizeof(create)))
>  		return -EFAULT;
> 
>  	head.flags  = create.flags;

-- 
Regards,

Laurent Pinchart



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ