From patchwork Wed May 29 20:21:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Meyer X-Patchwork-Id: 10967665 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A9C1F6C5 for ; Wed, 29 May 2019 20:40:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8B58328844 for ; Wed, 29 May 2019 20:40:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 79C972894E; Wed, 29 May 2019 20:40:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 250DB28844 for ; Wed, 29 May 2019 20:40:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726155AbfE2Uka (ORCPT ); Wed, 29 May 2019 16:40:30 -0400 Received: from www17.your-server.de ([213.133.104.17]:60010 "EHLO www17.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726125AbfE2Uka (ORCPT ); Wed, 29 May 2019 16:40:30 -0400 X-Greylist: delayed 1130 seconds by postgrey-1.27 at vger.kernel.org; Wed, 29 May 2019 16:40:29 EDT 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 1hW54w-0005yN-A2; Wed, 29 May 2019 22:21:42 +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 1hW54v-0006Vr-20; Wed, 29 May 2019 22:21:42 +0200 Received: by maria.localdomain (sSMTP sendmail emulation); Wed, 29 May 2019 22:21:40 +0200 From: "Thomas Meyer" Date: Wed, 29 May 2019 22:21:40 +0200 Subject: [PATCH] scsi: pmcraid: Use *_pool_zalloc rather than *_pool_alloc To: jejb@linux.ibm.com, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Mime-Version: 1.0 X-Patch: Cocci X-Mailer: DiffSplit Message-ID: <1559161113902-328168114-2-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: 2 X-Authenticated-Sender: thomas@m3y3r.de X-Virus-Scanned: Clear (ClamAV 0.100.3/25464/Wed May 29 09:59:09 2019) Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use *_pool_zalloc rather than *_pool_alloc followed by memset with 0. Signed-off-by: Thomas Meyer diff -u -p a/drivers/scsi/pmcraid.c b/drivers/scsi/pmcraid.c --- a/drivers/scsi/pmcraid.c +++ b/drivers/scsi/pmcraid.c @@ -4668,18 +4668,14 @@ static int pmcraid_allocate_control_bloc return -ENOMEM; for (i = 0; i < PMCRAID_MAX_CMD; i++) { - pinstance->cmd_list[i]->ioa_cb = - dma_pool_alloc( - pinstance->control_pool, - GFP_KERNEL, - &(pinstance->cmd_list[i]->ioa_cb_bus_addr)); + pinstance->cmd_list[i]->ioa_cb = dma_pool_zalloc(pinstance->control_pool, + GFP_KERNEL, + &(pinstance->cmd_list[i]->ioa_cb_bus_addr)); if (!pinstance->cmd_list[i]->ioa_cb) { pmcraid_release_control_blocks(pinstance, i); return -ENOMEM; } - memset(pinstance->cmd_list[i]->ioa_cb, 0, - sizeof(struct pmcraid_control_block)); } return 0; }