From patchwork Fri Aug 7 07:59:37 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Hajda X-Patchwork-Id: 6968671 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 26CCAC05AC for ; Fri, 7 Aug 2015 12:09:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6684320631 for ; Fri, 7 Aug 2015 12:09:12 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 26BC220434 for ; Fri, 7 Aug 2015 12:09:11 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 51CB82615F7; Fri, 7 Aug 2015 14:09:10 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,NO_DNS_FOR_FROM, RCVD_IN_DNSWL_LOW, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 80D662604AA; Fri, 7 Aug 2015 14:08:06 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id C5E8A260417; Fri, 7 Aug 2015 10:01:03 +0200 (CEST) Received: from mailout3.w1.samsung.com (mailout3.w1.samsung.com [210.118.77.13]) by alsa0.perex.cz (Postfix) with ESMTP id 4ED1B260417 for ; Fri, 7 Aug 2015 10:00:54 +0200 (CEST) Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout3.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NSP00D9VCXGB840@mailout3.w1.samsung.com> for alsa-devel@alsa-project.org; Fri, 07 Aug 2015 09:00:52 +0100 (BST) X-AuditID: cbfec7f5-f794b6d000001495-54-55c465b41344 Received: from eusync2.samsung.com ( [203.254.199.212]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id 7D.19.05269.4B564C55; Fri, 7 Aug 2015 09:00:52 +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:52 +0100 (BST) From: Andrzej Hajda To: Liam Girdwood , Mark Brown Date: Fri, 07 Aug 2015 09:59:37 +0200 Message-id: <1438934377-4922-32-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+NgFprKLMWRmVeSWpSXmKPExsVy+t/xK7pbUo+EGrw5q2Rxa905VosrFw8x WWycsZ7VYurDJ2wW3650MFlc3jWHzWLtkbvsDuweGz43sXnsnHWX3WPTqk42j74tqxg9Pm+S C2CN4rJJSc3JLEst0rdL4MrYfOATa8FF9ooXrRMZGxjXs3UxcnJICJhIPJo9kRHCFpO4cA8k zsUhJLCUUWLL1mdMEE4Tk8S+HbvZQarYBDQl/m6+CdYtIuAh0bp9AzNIEbPAaUaJrqWnmEAS wgJREp8794PZLAKqEv0vLoE18Ao4S/xftYcdYp2cxMljk1lBbE6g+MrumWC2kICTxJu+C8wT GHkXMDKsYhRNLU0uKE5KzzXSK07MLS7NS9dLzs/dxAgJrK87GJceszrEKMDBqMTDm/DvcKgQ a2JZcWXuIUYJDmYlEd6H+kAh3pTEyqrUovz4otKc1OJDjNIcLErivDN3vQ8REkhPLEnNTk0t SC2CyTJxcEo1MMrY89deEfsa3LZ8x32P5ywJTra/4jZxfrnuOYWdJc7B/bbDbW+XPXvFj4vp dcnPTTr+8J+lq8P+Ax8/XMpsd5Q837Bs04brL6ZmVZ27Kl4ov82em9l7r8ODGcd98mxn+xe0 TtubYPFSIbs+yL/zGF+wuv3RqfOmqZ5Om5apOn3xXnP3P9M73JRYijMSDbWYi4oTATI/9Ywo AgAA X-Mailman-Approved-At: Fri, 07 Aug 2015 14:08:03 +0200 Cc: Andrzej Hajda , alsa-devel@alsa-project.org, Marek Szyprowski , linux-kernel@vger.kernel.org, Bartlomiej Zolnierkiewicz Subject: [alsa-devel] [PATCH 31/31] sound/soc: use kmemdup rather than duplicating its implementation X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.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 --- sound/soc/soc-topology.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c index 4dadb5e..a5da91b 100644 --- a/sound/soc/soc-topology.c +++ b/sound/soc/soc-topology.c @@ -831,12 +831,12 @@ static int soc_tplg_denum_create_values(struct soc_enum *se, if (ec->items > sizeof(*ec->values)) return -EINVAL; - se->dobj.control.dvalues = - kmalloc(ec->items * sizeof(u32), GFP_KERNEL); + se->dobj.control.dvalues = kmemdup(ec->values, + ec->items * sizeof(u32), + GFP_KERNEL); if (!se->dobj.control.dvalues) return -ENOMEM; - memcpy(se->dobj.control.dvalues, ec->values, ec->items * sizeof(u32)); return 0; }