From patchwork Fri Aug 7 07:59:20 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Hajda X-Patchwork-Id: 6966351 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 44BA89F358 for ; Fri, 7 Aug 2015 08:13:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7E4D02062D for ; Fri, 7 Aug 2015 08:13:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 954A020613 for ; Fri, 7 Aug 2015 08:13:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751686AbbHGINC (ORCPT ); Fri, 7 Aug 2015 04:13:02 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:21613 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755326AbbHGIAh (ORCPT ); Fri, 7 Aug 2015 04:00:37 -0400 Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout1.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NSP00FDUCWZE640@mailout1.w1.samsung.com>; Fri, 07 Aug 2015 09:00:35 +0100 (BST) X-AuditID: cbfec7f4-f79c56d0000012ee-75-55c465a3c8ee Received: from eusync2.samsung.com ( [203.254.199.212]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id 40.94.04846.3A564C55; Fri, 7 Aug 2015 09:00:35 +0100 (BST) Received: from AMDC1061.digital.local ([106.116.147.88]) by eusync2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0NSP0013BCW67E10@eusync2.samsung.com>; Fri, 07 Aug 2015 09:00:35 +0100 (BST) From: Andrzej Hajda To: Nagalakshmi Nandigama , Praveen Krishnamoorthy , Sreekanth Reddy , Abhijit Mahajan Cc: Andrzej Hajda , Bartlomiej Zolnierkiewicz , Marek Szyprowski , linux-kernel@vger.kernel.org, MPT-FusionLinux.pdl@avagotech.com, linux-scsi@vger.kernel.org Subject: [PATCH 14/31] message/fusion: use kmemdup rather than duplicating its implementation Date: Fri, 07 Aug 2015 09:59:20 +0200 Message-id: <1438934377-4922-15-git-send-email-a.hajda@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1438934377-4922-1-git-send-email-a.hajda@samsung.com> References: <1438934377-4922-1-git-send-email-a.hajda@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprFLMWRmVeSWpSXmKPExsVy+t/xK7qLU4+EGtw+KG9xa905Vou1X2az W2ycsZ7V4vKuOWwW3dd3sFmsPXKX3eLghOusFg9nzWWyWLx+IbPFnHcdrA5cHsvOT2T26Nuy itHj8ya5AOYoLpuU1JzMstQifbsEroy2pxMYC/rZK9acmcDawPiDtYuRk0NCwERiwaRNjBC2 mMSFe+vZuhi5OIQEljJKXPr9iQnCaWKSWLhjBVgVm4CmxN/NN8GqRASeMUrsbTkM5jALvGWU mHl4ORtIlbBAvMTLqxuB2jk4WARUJe79dgAJ8wo4S1zcdYoJYp2cxMljk8HO4ASKr+yeCWYL CThJvOm7wDyBkXcBI8MqRtHU0uSC4qT0XEO94sTc4tK8dL3k/NxNjJAQ+7KDcfExq0OMAhyM Sjy8Cf8OhwqxJpYVV+YeYpTgYFYS4X2oDxTiTUmsrEotyo8vKs1JLT7EKM3BoiTOO3fX+xAh gfTEktTs1NSC1CKYLBMHp1QDY4fZtX13L/rOv+PP+0puy4QHT7WWTKu6r5jStL6dmdVS/EJW qqeCzYTl86KfOGxN0ftl/kNO0vc7+5Lddzw/JLR3fpm3R/JtzGn7PKaa4sNlu12XfDqVeXbH dF22nitttglXL2syzeJ+PH22+JqUGbrv+DuMdkcWlkgE/a15yyd3+vPvqhnv/iixFGckGmox FxUnAgA5zNRpLQIAAA== Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 The patch was generated using fixed coccinelle semantic patch scripts/coccinelle/api/memdup.cocci [1]. [1]: http://permalink.gmane.org/gmane.linux.kernel/2014320 Signed-off-by: Andrzej Hajda --- drivers/message/fusion/mptbase.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c index 5dcc031..1551f51 100644 --- a/drivers/message/fusion/mptbase.c +++ b/drivers/message/fusion/mptbase.c @@ -5971,13 +5971,12 @@ mpt_findImVolumes(MPT_ADAPTER *ioc) if (mpt_config(ioc, &cfg) != 0) goto out; - mem = kmalloc(iocpage2sz, GFP_KERNEL); + mem = kmemdup((u8 *)pIoc2, iocpage2sz, GFP_KERNEL); if (!mem) { rc = -ENOMEM; goto out; } - memcpy(mem, (u8 *)pIoc2, iocpage2sz); ioc->raid_data.pIocPg2 = (IOCPage2_t *) mem; mpt_read_ioc_pg_3(ioc);