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]
Message-ID: <20170827081657.GA5681@yuvallap>
Date:   Sun, 27 Aug 2017 11:16:58 +0300
From:   Yuval Shaia <yuval.shaia@...cle.com>
To:     Himanshu Jha <himanshujha199640@...il.com>
Cc:     selvin.xavier@...adcom.com, devesh.sharma@...adcom.com,
        somnath.kotur@...adcom.com, dledford@...hat.com,
        linux-rdma@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] RDMA/bnxt_re: remove unnecessary call to memset

On Fri, Aug 25, 2017 at 09:41:02PM +0530, Himanshu Jha wrote:
> call to memset to assign 0 value immediately after allocating
> memory with kzalloc is unnecesaary as kzalloc allocates the memory
> filled with 0 value.
> 
> Signed-off-by: Himanshu Jha <himanshujha199640@...il.com>
> ---
>  drivers/infiniband/hw/bnxt_re/ib_verbs.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/infiniband/hw/bnxt_re/ib_verbs.c b/drivers/infiniband/hw/bnxt_re/ib_verbs.c
> index f0e01b3..fa6fbac 100644
> --- a/drivers/infiniband/hw/bnxt_re/ib_verbs.c
> +++ b/drivers/infiniband/hw/bnxt_re/ib_verbs.c
> @@ -969,7 +969,6 @@ static struct bnxt_re_ah *bnxt_re_create_shadow_qp_ah
>  	if (!ah)
>  		return NULL;
>  
> -	memset(ah, 0, sizeof(*ah));
>  	ah->rdev = rdev;
>  	ah->qplib_ah.pd = &pd->qplib_pd;
>  
> @@ -1016,7 +1015,6 @@ static struct bnxt_re_qp *bnxt_re_create_shadow_qp
>  	if (!qp)
>  		return NULL;
>  
> -	memset(qp, 0, sizeof(*qp));
>  	qp->rdev = rdev;
>  
>  	/* Initialize the shadow QP structure from the QP1 values */
> -- 
> 2.7.4

FWIW

Reviewed-by: Yuval Shaia <yuval.shaia@...cle.com>

> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ