From patchwork Sat Oct 24 07:06:56 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: punit vara X-Patchwork-Id: 7479911 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id CFE579F36A for ; Sat, 24 Oct 2015 07:08:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E36FA208EC for ; Sat, 24 Oct 2015 07:08:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E8C43206AF for ; Sat, 24 Oct 2015 07:08:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751089AbbJXHHP (ORCPT ); Sat, 24 Oct 2015 03:07:15 -0400 Received: from mail-wi0-f176.google.com ([209.85.212.176]:34297 "EHLO mail-wi0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750714AbbJXHHO (ORCPT ); Sat, 24 Oct 2015 03:07:14 -0400 Received: by wikq8 with SMTP id q8so102702412wik.1; Sat, 24 Oct 2015 00:07:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=xUaQ6+OT7lDoBTIA3tJEx9oJGzSuf6V3AO/b2g8CVaQ=; b=X3QYzG18Oz66DeYkjjPJNMf/SamHSOkWuOAgm2rasrLpKmFH6M0eGL1RKlZvuPqpoG YU6YtXLA46O7muAgvGEHRsAnVS1xBJI9nd26FrtvtB7uVEraqDmSukIjO3QVKsqfwWpJ bQ9q/hgoUK+5dRpNk2vK8tvx3konfnYBvWkH1Q2FKkHAi9n7OI6gQYvq8rIIibz8eMKE PjfChXH1Gu+saj45VJKfPbNEgXts7nlgz4I2caAER0zgqx8529nt9pM+WCA98FbZkVzA i/PrwKcAqaMEIdVEpavOE8FCiGcntg60OMKKMymWUJnR/3IeldbogUuJfz+aYxiCFbdh WhCA== X-Received: by 10.28.137.82 with SMTP id l79mr919526wmd.95.1445670433368; Sat, 24 Oct 2015 00:07:13 -0700 (PDT) Received: from localhost.localdomain ([163.47.12.89]) by smtp.gmail.com with ESMTPSA id l1sm808464wmg.21.2015.10.24.00.07.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 24 Oct 2015 00:07:12 -0700 (PDT) From: Punit Vara To: JBottomley@odin.com Cc: don.brace@pmcs.com, storagedev@pmcs.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, mrochs@linux.vnet.ibm.com, Punit Vara Subject: [PATCH v2 1/2] scsi: lpfc: Use kzalloc instead of kmalloc Date: Sat, 24 Oct 2015 12:36:56 +0530 Message-Id: <1445670416-3705-1-git-send-email-punitvara@gmail.com> X-Mailer: git-send-email 2.5.3 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SBL_CSS, RP_MATCHES_RCVD, T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Reviewed-by: Matthew R. Ochs Reviewed-by: Sebastian Herbszt --- 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;