From: Punit Vara Date: Wed, 16 Dec 2015 23:12:07 +0000 (-0500) Subject: lpfc: Use kzalloc instead of kmalloc X-Git-Tag: v4.1.12-92~196^2~5 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=1990059714ddaf2da7b98baa41eab9aa28d05566;p=users%2Fjedix%2Flinux-maple.git lpfc: Use kzalloc instead of kmalloc 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 Signed-off-by: James Smart Reviewed-by: Hannes Reinicke Reviewed-by: Matthew R. Ochs Reviewed-by: Sebastian Herbszt Signed-off-by: Martin K. Petersen (cherry picked from commit 699acd6220ea5b20b25d5eec0ab448827d745357) Orabug: 22493326 Signed-off-by: Manjunath Govindashetty --- diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c index c5fba8468bfa8..3f287ee5e57b1 100644 --- a/drivers/scsi/lpfc/lpfc_els.c +++ b/drivers/scsi/lpfc/lpfc_els.c @@ -5026,13 +5026,12 @@ 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; } - memset(rdp_context, 0, sizeof(struct lpfc_rdp_context)); cmd = &cmdiocb->iocb; rdp_context->ndlp = lpfc_nlp_get(ndlp); rdp_context->ox_id = cmd->unsli3.rcvsli3.ox_id;