From patchwork Sun Aug 28 17:39:45 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Iooss X-Patchwork-Id: 9304377 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0177460756 for ; Mon, 29 Aug 2016 19:23:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E56DE2885A for ; Mon, 29 Aug 2016 19:23:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DA2EC28966; Mon, 29 Aug 2016 19:23:12 +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=-1.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 945822885A for ; Mon, 29 Aug 2016 19:23:11 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id B7C1E2677CB; Mon, 29 Aug 2016 21:23:10 +0200 (CEST) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 36EA4266702; Mon, 29 Aug 2016 20:43:53 +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 62F14266702; Mon, 29 Aug 2016 20:43:52 +0200 (CEST) Received: from mx1.polytechnique.org (mx1.polytechnique.org [129.104.30.34]) by alsa0.perex.cz (Postfix) with ESMTP id 8E35A266C04 for ; Mon, 29 Aug 2016 19:32:37 +0200 (CEST) Received: from localhost.localdomain (32.206.133.77.rev.sfr.net [77.133.206.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ssl.polytechnique.org (Postfix) with ESMTPSA id 1BA0D560667; Sun, 28 Aug 2016 19:40:25 +0200 (CEST) From: Nicolas Iooss To: Liam Girdwood , Mark Brown , alsa-devel@alsa-project.org Date: Sun, 28 Aug 2016 19:39:45 +0200 Message-Id: <20160828173945.27721-1-nicolas.iooss_linux@m4x.org> X-Mailer: git-send-email 2.9.3 X-AV-Checked: ClamAV using ClamSMTP at svoboda.polytechnique.org (Sun Aug 28 19:40:25 2016 +0200 (CEST)) Cc: Nicolas Iooss , linux-kernel@vger.kernel.org Subject: [alsa-devel] [PATCH 1/1] ASoC: Intel: Atom: add a missing star in a memcpy call 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 In sst_prepare_and_post_msg(), when a response is received in "block", the following code gets executed: *data = kzalloc(block->size, GFP_KERNEL); memcpy(data, (void *) block->data, block->size); The memcpy() call overwrites the content of the *data pointer instead of filling the newly-allocated memory (which pointer is hold by *data). Fix this by using *data in the memcpy() call. Fixes: 60dc8dbacb00 ("ASoC: Intel: sst: Add some helper functions") Cc: stable@vger.kernel.org # 3.19.x Signed-off-by: Nicolas Iooss --- sound/soc/intel/atom/sst/sst_pvt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/intel/atom/sst/sst_pvt.c b/sound/soc/intel/atom/sst/sst_pvt.c index adb32fefd693..7c398b7c9d4b 100644 --- a/sound/soc/intel/atom/sst/sst_pvt.c +++ b/sound/soc/intel/atom/sst/sst_pvt.c @@ -289,7 +289,7 @@ int sst_prepare_and_post_msg(struct intel_sst_drv *sst, ret = -ENOMEM; goto out; } else - memcpy(data, (void *) block->data, block->size); + memcpy(*data, (void *) block->data, block->size); } } out: