From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753081AbbJWX03 (ORCPT ); Fri, 23 Oct 2015 19:26:29 -0400 Received: from e38.co.us.ibm.com ([32.97.110.159]:55808 "EHLO e38.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752085AbbJWX00 convert rfc822-to-8bit (ORCPT ); Fri, 23 Oct 2015 19:26:26 -0400 X-IBM-Helo: d03dlp02.boulder.ibm.com X-IBM-MailFrom: mrochs@linux.vnet.ibm.com X-IBM-RcptTo: linux-kernel@vger.kernel.org;linux-scsi@vger.kernel.org Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: [PATCH 1/2] scsi: lpfc: Use kzalloc instead of kmalloc From: "Matthew R. Ochs" In-Reply-To: <1445630633-14209-2-git-send-email-punitvara@gmail.com> Date: Fri, 23 Oct 2015 18:26:21 -0500 Cc: JBottomley@odin.com, don.brace@pmcs.com, storagedev@pmcs.com, iss_storagedev@hp.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8BIT Message-Id: References: <1445630633-14209-1-git-send-email-punitvara@gmail.com> <1445630633-14209-2-git-send-email-punitvara@gmail.com> To: Punit Vara X-Mailer: Apple Mail (2.2104) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15102323-0029-0000-0000-00000D9B4765 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Punit, Aren't you missing the removal of the memset() as part of this conversion? -matt > On Oct 23, 2015, at 3:03 PM, Punit Vara wrote: > > This patch is to the lpfc_els.c which resolves following warning > reported by coccicheck: > > WARNING: kzalloc should be used for rdp_context, instead of > kmalloc/memset > > Signed-off-by: Punit Vara > --- > drivers/scsi/lpfc/lpfc_els.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c > index 36bf58b..422c800 100644 > --- a/drivers/scsi/lpfc/lpfc_els.c > +++ b/drivers/scsi/lpfc/lpfc_els.c > @@ -4990,7 +4990,7 @@ lpfc_els_rcv_rdp(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb, > if (RDP_NPORT_ID_SIZE != > be32_to_cpu(rdp_req->nport_id_desc.length)) > goto rjt_logerr; > - rdp_context = kmalloc(sizeof(struct lpfc_rdp_context), GFP_KERNEL); > + rdp_context = kzalloc(sizeof(struct lpfc_rdp_context), GFP_KERNEL); > if (!rdp_context) { > rjt_err = LSRJT_UNABLE_TPC; > goto error;