Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 699acd62 authored by Punit Vara's avatar Punit Vara Committed by Martin K. Petersen
Browse files

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: default avatarPunit Vara <punitvara@gmail.com>
Signed-off-by: default avatarJames Smart <james.smart@avagotech.com>
Reviewed-by: default avatarHannes Reinicke <hare@suse.de>
Reviewed-by: default avatarMatthew R. Ochs <mrochs@linux.vnet.ibm.com>
Reviewed-by: default avatarSebastian Herbszt <herbszt@gmx.de>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 9be32181
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -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;