From patchwork Thu Oct 29 22:04:41 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Vincent_Stehl=C3=A9?= X-Patchwork-Id: 7521371 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 5396ABEEA4 for ; Thu, 29 Oct 2015 22:05:31 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 73F96208B1 for ; Thu, 29 Oct 2015 22:05:30 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 05F952089C for ; Thu, 29 Oct 2015 22:05:29 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id C790F26586F; Thu, 29 Oct 2015 23:05:27 +0100 (CET) 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,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 0B4A6265522; Thu, 29 Oct 2015 23:05:19 +0100 (CET) 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 34966265558; Thu, 29 Oct 2015 23:05:18 +0100 (CET) Received: from smtp3-g21.free.fr (smtp3-g21.free.fr [212.27.42.3]) by alsa0.perex.cz (Postfix) with ESMTP id 0F2F02651A5 for ; Thu, 29 Oct 2015 23:05:12 +0100 (CET) Received: from romuald.bergerie (unknown [88.178.86.202]) by smtp3-g21.free.fr (Postfix) with ESMTPS id 26280A61D3; Thu, 29 Oct 2015 23:05:10 +0100 (CET) Received: from radicelle.bergerie (radicelle.bergerie [192.168.124.12]) by romuald.bergerie (Postfix) with SMTP id B9742EB725F; Thu, 29 Oct 2015 23:05:08 +0100 (CET) Received: by radicelle.bergerie (sSMTP sendmail emulation); Thu, 29 Oct 2015 23:05:08 +0100 From: =?UTF-8?q?Vincent=20Stehl=C3=A9?= To: alsa-devel@alsa-project.org Date: Thu, 29 Oct 2015 23:04:41 +0100 Message-Id: <1446156281-31024-1-git-send-email-vincent.stehle@laposte.net> X-Mailer: git-send-email 2.6.1 MIME-Version: 1.0 Cc: trivial@kernel.org, Vinod Koul , linux-kernel@vger.kernel.org, =?UTF-8?q?Vincent=20Stehl=C3=A9?= , Mark Brown , Jeeja KP , "Subhransu S . Prusty" Subject: [alsa-devel] [PATCH] ASoC: Intel: Skylake: fix typo in sizeof 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 The size of the pointer to a data structure to send is erroneously passed to sst_ipc_tx_message_wait() as its tx_bytes argument. It should be given the size of the pointed skl_ipc_dxstate_info structure instead. Coincidentally, both the pointer and the structure have the same size of 8 bytes on a 64 bit machine, which "masks" the issue. Compiling for 32 bit reveals the issue more clearly. Fix the typo for correctness, and to make the code robust to future evolutions of the skl_ipc_dxstate_info structure size. This fixes the following coccicheck error: sound/soc/intel/skylake/skl-sst-ipc.c:641:8-14: ERROR: application of sizeof to pointer Signed-off-by: Vincent Stehlé Cc: Subhransu S. Prusty Cc: Jeeja KP Cc: Vinod Koul Cc: Mark Brown Cc: trivial@kernel.org --- sound/soc/intel/skylake/skl-sst-ipc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/intel/skylake/skl-sst-ipc.c b/sound/soc/intel/skylake/skl-sst-ipc.c index 937a0a3..9aee835 100644 --- a/sound/soc/intel/skylake/skl-sst-ipc.c +++ b/sound/soc/intel/skylake/skl-sst-ipc.c @@ -638,7 +638,7 @@ int skl_ipc_set_dx(struct sst_generic_ipc *ipc, u8 instance_id, dev_dbg(ipc->dev, "In %s primary =%x ext=%x\n", __func__, header.primary, header.extension); ret = sst_ipc_tx_message_wait(ipc, *ipc_header, - dx, sizeof(dx), NULL, 0); + dx, sizeof(*dx), NULL, 0); if (ret < 0) { dev_err(ipc->dev, "ipc: set dx failed, err %d\n", ret); return ret;