From: Punit Vara Date: Wed, 16 Dec 2015 23:12:07 +0000 (-0500) Subject: lpfc: Use kzalloc instead of kmalloc X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=699acd6220ea5b20b25d5eec0ab448827d745357;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.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 --- diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c index 273a1db5c5aa..7f5abb8f52bc 100644 --- a/drivers/scsi/lpfc/lpfc_els.c +++ b/drivers/scsi/lpfc/lpfc_els.c @@ -5016,13 +5016,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;