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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210902103428.bdbkybvi6he6mgy2@maple.lan>
Date:   Thu, 2 Sep 2021 11:34:28 +0100
From:   Daniel Thompson <daniel.thompson@...aro.org>
To:     CGEL <cgel.zte@...il.com>
Cc:     Jens Wiklander <jens.wiklander@...aro.org>,
        Sumit Garg <sumit.garg@...aro.org>,
        op-tee@...ts.trustedfirmware.org, linux-kernel@...r.kernel.org,
        jing yangyang <jing.yangyang@....com.cn>,
        Zeal Robot <zealci@....com.cn>
Subject: Re: [PATCH linux-next] tee/optee/shm_pool: fix application of sizeof
 to pointer

On Thu, Aug 19, 2021 at 08:21:27PM -0700, CGEL wrote:
> From: jing yangyang <jing.yangyang@....com.cn>
> 
> sizeof when applied to a pointer typed expression gives the size of
> the pointer.
> 
> ./drivers/tee/optee/shm_pool.c:38:28-34: ERROR application of sizeof to pointer
> 
> This issue was detected with the help of Coccinelle.
> 
> Reported-by: Zeal Robot <zealci@....com.cn>
> Signed-off-by: jing yangyang <jing.yangyang@....com.cn>

This should not affect code generation since both pages and *pages are
pointers but the change looks good to me.

Reviewed-by: Daniel Thompson <daniel.thompson@...aro.org>


> ---
>  drivers/tee/optee/shm_pool.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/tee/optee/shm_pool.c b/drivers/tee/optee/shm_pool.c
> index c41a9a5..d167039 100644
> --- a/drivers/tee/optee/shm_pool.c
> +++ b/drivers/tee/optee/shm_pool.c
> @@ -35,7 +35,7 @@ static int pool_op_alloc(struct tee_shm_pool_mgr *poolm,
>  		unsigned int nr_pages = 1 << order, i;
>  		struct page **pages;
>  
> -		pages = kcalloc(nr_pages, sizeof(pages), GFP_KERNEL);
> +		pages = kcalloc(nr_pages, sizeof(*pages), GFP_KERNEL);
>  		if (!pages) {
>  			rc = -ENOMEM;
>  			goto err;
> -- 
> 1.8.3.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ