Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp6798917ybi; Wed, 29 May 2019 13:23:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqxZno8D0RT02yrvW6K2AnACSH/oA4mOXWqxU1b+zTcrsmUyMCPX3H7FOKY5DbUBuqOrkiqn X-Received: by 2002:a17:902:ac8b:: with SMTP id h11mr29092377plr.31.1559161384848; Wed, 29 May 2019 13:23:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559161384; cv=none; d=google.com; s=arc-20160816; b=tYB5xkTMw2PirsPlcnWVGcRPV2Z/kA/bb6kaCUBXydzaTYzI98k+sB+I4JQHe8rsaw 9NVJoj20eCJnkkNdmMcLOrXBb0Z/OtW3YIncXXTiK0b2Vj0+5HdjCOTsBO+q4GSxv7Sz JPfIur7GNWakEwEmjbGlDg6L5cIEE3wEfDEPyXfaGwRpuBUBHHegQczH2fid9F/RPtw8 m6wGKNmwLAr2FPw6Qaymha1PY4C/kvQqh4YLVDYu4rRq4F1k+pdbbGrBcLXHbEpsxGT1 +BYDvdqpJG9QjSW4S3lywv1/NOtrUPHhwylq3qxpLZkK24+zGbuljPdj/FRh+gipGmm3 bpIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:references:message-id :content-transfer-encoding:mime-version:to:subject:date:from; bh=zdGraqh8Em8XXYNALpeiKsjaWCvFIDxkIpVMLfES8iE=; b=x8h04kvVi8/+wiB4VtWDesYEil5C8gEzA1z9DhLC71P7yvYgJ8iO8X18KF80sHj3ad B4RqFgdAulOoBo/O36jPSZehy3nx9xktUL8DIySehDLrax6HllzTtmwsv8JFUVSOACpq cq1fKOz2HIp8c6dHPUEhOZWNYfGq1D/WYO4a4HpoQ96PWqsUow9yx/UUEFILDj+nMzLo 5Hu2sn7LbvANAsF+ejvZGjJPfcxRczIJtRsuZVaaJYjWhR8X8DeGDsI0V7ENvyW0YeEx 2a+jRHXpJcthYdFMTJpPxue9r9pLXNDL/kkjtujGOOsEarj9KpozPqtruis/3miP5V0T hUhw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h4si781604pgq.456.2019.05.29.13.22.49; Wed, 29 May 2019 13:23:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726439AbfE2UVk (ORCPT + 99 others); Wed, 29 May 2019 16:21:40 -0400 Received: from www17.your-server.de ([213.133.104.17]:55956 "EHLO www17.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725990AbfE2UVk (ORCPT ); Wed, 29 May 2019 16:21:40 -0400 Received: from [88.198.220.130] (helo=sslproxy01.your-server.de) by www17.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89_1) (envelope-from ) id 1hW54s-0005y9-E9; Wed, 29 May 2019 22:21:38 +0200 Received: from [2a02:908:4c22:ec00:915f:2518:d2f6:b586] (helo=maria.localdomain) by sslproxy01.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89) (envelope-from ) id 1hW54r-0006OR-5S; Wed, 29 May 2019 22:21:38 +0200 Received: by maria.localdomain (sSMTP sendmail emulation); Wed, 29 May 2019 22:21:36 +0200 From: "Thomas Meyer" Date: Wed, 29 May 2019 22:21:36 +0200 Subject: [PATCH] scsi: lpfc: Use *_pool_zalloc rather than *_pool_alloc To: james.smart@broadcom.com, dick.kennedy@broadcom.com, jejb@linux.ibm.com, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patch: Cocci X-Mailer: DiffSplit Message-ID: <1559161113901-1017843021-1-diffsplit-thomas@m3y3r.de> References: <1559161113889-196429735-0-diffsplit-thomas@m3y3r.de> In-Reply-To: <1559161113889-196429735-0-diffsplit-thomas@m3y3r.de> X-Serial-No: 1 X-Authenticated-Sender: thomas@m3y3r.de X-Virus-Scanned: Clear (ClamAV 0.100.3/25464/Wed May 29 09:59:09 2019) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use *_pool_zalloc rather than *_pool_alloc followed by memset with 0. Signed-off-by: Thomas Meyer --- diff -u -p a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c @@ -4114,14 +4114,13 @@ lpfc_new_io_buf(struct lpfc_hba *phba, i * pci bus space for an I/O. The DMA buffer includes the * number of SGE's necessary to support the sg_tablesize. */ - lpfc_ncmd->data = dma_pool_alloc(phba->lpfc_sg_dma_buf_pool, - GFP_KERNEL, - &lpfc_ncmd->dma_handle); + lpfc_ncmd->data = dma_pool_zalloc(phba->lpfc_sg_dma_buf_pool, + GFP_KERNEL, + &lpfc_ncmd->dma_handle); if (!lpfc_ncmd->data) { kfree(lpfc_ncmd); break; } - memset(lpfc_ncmd->data, 0, phba->cfg_sg_dma_buf_size); /* * 4K Page alignment is CRITICAL to BlockGuard, double check