From patchwork Sun Apr 13 17:56:36 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Engelmayer X-Patchwork-Id: 3974611 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.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4271EBFF02 for ; Sun, 13 Apr 2014 17:57:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7231E2024D for ; Sun, 13 Apr 2014 17:57:21 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 17440201E4 for ; Sun, 13 Apr 2014 17:57:19 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 2CEEF2617AA; Sun, 13 Apr 2014 19:57:17 +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=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id B34AE261734; Sun, 13 Apr 2014 19:57:08 +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 8BCFC261736; Sun, 13 Apr 2014 19:57:07 +0200 (CEST) Received: from mout.gmx.net (mout.gmx.net [212.227.17.22]) by alsa0.perex.cz (Postfix) with ESMTP id A0CAF261734 for ; Sun, 13 Apr 2014 19:56:59 +0200 (CEST) Received: from spike ([81.217.122.98]) by mail.gmx.com (mrgmx102) with ESMTPSA (Nemesis) id 0MOCSm-1WeuQn2xgC-005aBC; Sun, 13 Apr 2014 19:56:57 +0200 Date: Sun, 13 Apr 2014 19:56:36 +0200 From: Christian Engelmayer To: Liam Girdwood Message-ID: <20140413195636.32f31cb2@spike> X-Mailer: Claws Mail 3.8.1 (GTK+ 2.24.20; x86_64-pc-linux-gnu) Mime-Version: 1.0 X-Provags-ID: V03:K0:CKayOFTwZGvnHc67J5/+XCcnDeWX6o3Du7ocaZ9bSOvNp5+Gfo+ YoimSEf9QID0zNvdMBxq0H+N21KLjaFb/hK2BWZgd9iWo80yVy0VTq3rl4a64XMWvIafj3I hFaSRa8pxkinPO9WxHhf9FkXiNKLk/zk1y4vYMd0sPm62ZmyeBJh8MxoyuX2FBlEVrVZibf 1MKuc6HToyj9tUK3uDZYQ== Cc: alsa-devel@alsa-project.org, Takashi Iwai , linux-kernel@vger.kernel.org, Mark Brown , Dan Carpenter Subject: [alsa-devel] [PATCH] ASoC: Intel: Fix incorrect sizeof() in sst_hsw_stream_get_volume() 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Fix an incorrect sizeof() usage in sst_hsw_stream_get_volume(). sst_dsp_read() is called to read into a variable of type u32, but is passed sizeof(u32 *) for argument 'size_t bytes'. Detected by Coverity: CID 1195260. Signed-off-by: Christian Engelmayer --- sound/soc/intel/sst-haswell-ipc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sound/soc/intel/sst-haswell-ipc.c b/sound/soc/intel/sst-haswell-ipc.c index f46bb4d..455a185 100644 --- a/sound/soc/intel/sst-haswell-ipc.c +++ b/sound/soc/intel/sst-haswell-ipc.c @@ -991,7 +991,8 @@ int sst_hsw_stream_get_volume(struct sst_hsw *hsw, struct sst_hsw_stream *stream return -EINVAL; sst_dsp_read(hsw->dsp, volume, - stream->reply.volume_register_address[channel], sizeof(volume)); + stream->reply.volume_register_address[channel], + sizeof(*volume)); return 0; }