Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1422746AbbHGIA5 (ORCPT ); Fri, 7 Aug 2015 04:00:57 -0400 Received: from mailout3.w1.samsung.com ([210.118.77.13]:28674 "EHLO mailout3.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1422681AbbHGIAy (ORCPT ); Fri, 7 Aug 2015 04:00:54 -0400 X-AuditID: cbfec7f5-f794b6d000001495-54-55c465b41344 From: Andrzej Hajda To: Liam Girdwood , Mark Brown Cc: Andrzej Hajda , Bartlomiej Zolnierkiewicz , Marek Szyprowski , linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org Subject: [PATCH 31/31] sound/soc: use kmemdup rather than duplicating its implementation 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 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1189 Lines: 38 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; } -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/