Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752979AbbKVXKh (ORCPT ); Sun, 22 Nov 2015 18:10:37 -0500 Received: from mout.gmx.net ([212.227.17.20]:51534 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752686AbbKVXKf (ORCPT ); Sun, 22 Nov 2015 18:10:35 -0500 Date: Mon, 23 Nov 2015 00:10:06 +0100 From: Sebastian Herbszt To: Punit Vara Cc: JBottomley@odin.com, don.brace@pmcs.com, storagedev@pmcs.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, mrochs@linux.vnet.ibm.com, James Smart , Sebastian Herbszt Subject: Re: [PATCH v2 1/2] scsi: lpfc: Use kzalloc instead of kmalloc Message-ID: <20151123001006.00002fc3@localhost> In-Reply-To: <1445670416-3705-1-git-send-email-punitvara@gmail.com> References: <1445670416-3705-1-git-send-email-punitvara@gmail.com> X-Mailer: Claws Mail 3.9.2-55-g74b05b (GTK+ 2.16.6; i586-pc-mingw32msvc) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:AoIrh8J+j2InFM0icWHHse6RaboEHBaD654Anqk2fSqZ9GqFaFD nRNRvQW/ooR0TF025HWx1UPgkcBOet5wns8IUDQjJm0pqLq2LeVNCCcYv6xY+6YLVmCk6al RRE7n4IW1GNG792iZmum4PZGfYsQhUWPv4GudO8Ha4o7MYrerpe+TlcX0RYut1UKL81DZo5 JPSwbVB3PkMG4lHDq2uhA== X-UI-Out-Filterresults: notjunk:1;V01:K0:5kvWrQT5Y5M=:YLgoUgrVjKHw/hUYvSzJZy 1+eGVJT5lyprJdhaQikkMjso6X90I34KRlbgg949Igph/ZtOtmC9CWxca9vcFABW8kGCdVFeH 7CgFbJoj3/9TgrQ6xYJ3miUX4AA5kmARQfplycRQgVFZ2m50EU/cGoImvB1zbOYl+eOvsBBAF YvcClN6k4HNG9Xk58KL2b5f7e3VItqfjg7CJVu1VwucXNdmBruc+P5ZgxhgGTBQt+ai47bl/H GbhQlZdJ2SDp5LJmOhlzFSF0WpVNmUzvtxJBV/kgRp1no3rPB+F9CRr7PVBlIWClfueA0bGix +wDko9lGBMJ/64laq5dEGrGvf8q0b56z3mhizMg4iNvyz67+hodMTSjmSHhbVQr91GxqwNKsh nuaXlbt9U5GD30ApJuCEbAIgG6jRbvLkSIE7IqDyMsBZveGJrG+tNIJXUSsaoky9X7zHyZ4Ew wg1qxy5RNNOf0FizS1iStAziXrrBWujaSb2T+y6NGsVJeRcvooixfF3rwzELv6vi2/P6zYlrD fQLY2A+UJTI0plHkGFAZCD0iARzAlQP5sW6KRvmgalzXdL1hIcDoc8JFLskiRuBFbwBqnRbDj ChSyZlWRMY+ADDEjfh9MJ4HMmifPkuV8w6fDHt9LHYLqdmI0oKhhXH9csuAOcNNAQvNhZeFSf OYufmlZi/zVYIsGlUBmmRncZdtp7CArk8nJATZ6bdOowSPXshPx/KNuU8bRE68i2YPuU3AcLe aVuif4PfQ/38zdsyjwTGAHr3u7jmJDax7hYkT2aIoJ7XMrnKawlEjyTLn+49N+wdfNLqYcmc7 k0jAILL Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1429 Lines: 38 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 | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c > index 36bf58b..9729ab1 100644 > --- a/drivers/scsi/lpfc/lpfc_els.c > +++ b/drivers/scsi/lpfc/lpfc_els.c > @@ -4990,13 +4990,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; Reviewed-by: Sebastian Herbszt -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/