From patchwork Fri Aug 7 07:59:36 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Hajda X-Patchwork-Id: 6968661 Return-Path: X-Original-To: patchwork-alsa-devel@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 825749F38B for ; Fri, 7 Aug 2015 12:08:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B6A4920632 for ; Fri, 7 Aug 2015 12:08:41 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id F257F2062D for ; Fri, 7 Aug 2015 12:08:39 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 0321C2614E2; Fri, 7 Aug 2015 14:08:39 +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 DB73B26044D; Fri, 7 Aug 2015 14:08:05 +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 90440260425; Fri, 7 Aug 2015 10:01:00 +0200 (CEST) Received: from mailout3.w1.samsung.com (mailout3.w1.samsung.com [210.118.77.13]) by alsa0.perex.cz (Postfix) with ESMTP id 31723260415 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 <0NSP00E6VCXFC740@mailout3.w1.samsung.com> for alsa-devel@alsa-project.org; Fri, 07 Aug 2015 09:00:51 +0100 (BST) X-AuditID: cbfec7f5-f794b6d000001495-4f-55c465b3ba6a Received: from eusync2.samsung.com ( [203.254.199.212]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id 1C.19.05269.3B564C55; Fri, 7 Aug 2015 09:00:51 +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:51 +0100 (BST) From: Andrzej Hajda To: Liam Girdwood , Mark Brown Date: Fri, 07 Aug 2015 09:59:36 +0200 Message-id: <1438934377-4922-31-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+NgFlrBLMWRmVeSWpSXmKPExsVy+t/xK7qbU4+EGiy9Im1xa905VosrFw8x WWycsZ7VYurDJ2wW3650MFlc3jWHzWLtkbvsFp27+lktNnxfy+jA6bHhcxObx85Zd9k9Nq3q ZPPY93YZm0ffllWMHuu3XGXx+LxJLoA9issmJTUnsyy1SN8ugStj4pxdTAXf2CvW7N7P2MB4 ka2LkZNDQsBE4tqOHUwQtpjEhXvrgeJcHEICSxklDr7pZoVwmpgkfk99DNbBJqAp8XfzTTBb RMBDonX7BmaQImaBPiaJ5edWAyU4OIQFoiU2TPcGqWERUJV4tu8yC4jNK+AssbC/gR1im5zE yWOTWUFsTqD4yu6ZYLaQgJPEm74LzBMYeRcwMqxiFE0tTS4oTkrPNdIrTswtLs1L10vOz93E CAm/rzsYlx6zOsQowMGoxMOb8O9wqBBrYllxZe4hRgkOZiUR3of6QCHelMTKqtSi/Pii0pzU 4kOM0hwsSuK8M3e9DxESSE8sSc1OTS1ILYLJMnFwSjUwJvAmLmHSSD5w9kqzS8m6F3Gt0yrF FLaeNtgtcWW7hifLgYaNCeLClyz5331Uf36qZOKxV7LZ/785/t//4HJMW0vnNadanjtifSs5 climxT5dae0ranf6SsL70h8ntHfyaeXITjwp+C8wWOPH1aJ0I3P+QDXbOz8fuz1l2C34V0Gi XWN2bK+cEktxRqKhFnNRcSIAy2nhMjsCAAA= X-Mailman-Approved-At: Fri, 07 Aug 2015 14:08:03 +0200 Cc: alsa-devel@alsa-project.org, Bartlomiej Zolnierkiewicz , linux-kernel@vger.kernel.org, Takashi Iwai , Andrzej Hajda , Marek Szyprowski Subject: [alsa-devel] [PATCH 30/31] sound/atom: 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/intel/atom/sst/sst_ipc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sound/soc/intel/atom/sst/sst_ipc.c b/sound/soc/intel/atom/sst/sst_ipc.c index 5a27861..3dc7358 100644 --- a/sound/soc/intel/atom/sst/sst_ipc.c +++ b/sound/soc/intel/atom/sst/sst_ipc.c @@ -352,10 +352,9 @@ void sst_process_reply_mrfld(struct intel_sst_drv *sst_drv_ctx, * copy from mailbox **/ if (msg_high.part.large) { - data = kzalloc(msg_low, GFP_KERNEL); + data = kmemdup((void *)msg->mailbox_data, msg_low, GFP_KERNEL); if (!data) return; - memcpy(data, (void *) msg->mailbox_data, msg_low); /* Copy command id so that we can use to put sst to reset */ dsp_hdr = (struct ipc_dsp_hdr *)data; cmd_id = dsp_hdr->cmd_id;