]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
lpfc: Use kzalloc instead of kmalloc
authorPunit Vara <punitvara@gmail.com>
Wed, 16 Dec 2015 23:12:07 +0000 (18:12 -0500)
committerChuck Anderson <chuck.anderson@oracle.com>
Fri, 26 Feb 2016 02:38:01 +0000 (18:38 -0800)
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 <punitvara@gmail.com>
Signed-off-by: James Smart <james.smart@avagotech.com>
Reviewed-by: Hannes Reinicke <hare@suse.de>
Reviewed-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com>
Reviewed-by: Sebastian Herbszt <herbszt@gmx.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 699acd6220ea5b20b25d5eec0ab448827d745357)

Orabug: 22493326

Signed-off-by: Manjunath Govindashetty <manjunath.govindashetty@oracle.com>
drivers/scsi/lpfc/lpfc_els.c

index c5fba8468bfa8f1ad0598963fbfbe746adb434af..3f287ee5e57b19cc6aafc21b20049a2d4d4e315d 100644 (file)
@@ -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;