Message ID | 20230530072648.13998-1-luhongfei@vivo.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <alsa-devel-bounces@alsa-project.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 02EE8C7EE2A for <alsa-devel@archiver.kernel.org>; Thu, 1 Jun 2023 16:05:45 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 1FD0D6C1; Thu, 1 Jun 2023 18:04:54 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 1FD0D6C1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1685635544; bh=/VhYLbLvu0xDQluYtDvuWOtTgBHaYG0/oSK0dCR6dsI=; h=From:To:Cc:Subject:Date:List-Id:List-Archive:List-Help:List-Owner: List-Post:List-Subscribe:List-Unsubscribe:From; b=nzIIiwdz+2Gyg7tse+7foWNqxWlVQ3HcepkT9GpeLmkE1EuIREkYAjNCA+oP7AdxP bcp4A+NObscrqcbuI1ArSZQf0qg5/PwfRg66jiXEhVtxmsVzK0OmUuC39E5PEzxDk3 ThDn2E+YLhVo0ZSH9MwCYOuzCfqWc2OfM395QvqY= Received: by alsa1.perex.cz (Postfix, from userid 50401) id B9787F805D4; Thu, 1 Jun 2023 18:02:46 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 38DAEF805D3; Thu, 1 Jun 2023 18:02:46 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 9EFB0F80528; Tue, 30 May 2023 09:27:17 +0200 (CEST) Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on20708.outbound.protection.outlook.com [IPv6:2a01:111:f400:feab::708]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 149BDF80552; Tue, 30 May 2023 09:27:07 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 149BDF80552 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=vivo.com header.i=@vivo.com header.a=rsa-sha256 header.s=selector2 header.b=ok5zg+yH ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GR370He9LUpAZ+C49OkvP6ujKKGTrOYaGKaAO68biXwRhWi62Bu/VSegSSRyjaKZ+0QOuKgOn+N/VqMF+xJ5Cb6D+3pBXnjIcFhQ8z6waa/muNk3D+8lR88FSc9D6WqjAfHK9UQGdKkPKm/UEXV0FKw2ODF/NNP/6XwqkUhIEQI+QJn9oCiFXiBamwiNewTkmiXtq3gyMH7ei3sfSdz+LSuT80eBLoNL8Cnt0QFbj320Vv120tRaSecBa6Fy7Pr1TlJXXyuFdWoEOWmPgQE/+ZXsCJhpPHg2Tk3pyUzwhqB+3grAfp2rVhrwwshunfgwuQ4njYfFBdX96ywsXsqTrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=uOrbsqZE2NtiZFd3LXLoXD3PLTMmCfCXoLJozvzxiX8=; b=aLDFv1KSQvBcDfx18CN7E9MNgDj055Y977zOwYUNdyED0PwZSkSLpXbStqZ10izxcrLQaFunwsOhvO8JYIYjf5BBR4FoH2h4AzpDhUNB09InDEdU5M7gJnmzCn9qBIMHewEvc/TTWKVH23f+oVTHSdkOj/TAGw8OasaWUzNGxZBxa3YF51hPSLpImM3VawrjYkDTOL8qIWZs1r9zoo1Awr4yTLHdhwik+12BSRh6k0/Z3MNlzDtQTV1D7qHeRRjKQNM1I0IuVbEuYESE9IuGOfyP/vDI5MjqYmmG+9r4X/WDdrLOTEATpzUbXoUqAjBjc3Idrh7YJNkA2E4l6cOjPw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uOrbsqZE2NtiZFd3LXLoXD3PLTMmCfCXoLJozvzxiX8=; b=ok5zg+yHwfD6dWPumGx6kX3DPC0Bc9fhuic77KskX7mzILUixZCuCAznVK6hU81D+AI/c4kWx7ZBZdWU8n9s9y+yvRMR1ijy+AqE/lUsIb7/H7JLIgMwQ+YPZ+B20vXjVXtb+9WyMkglEEGUgtWfezSf199+hRoyoTMNYDaJhDJnWG2B5fas7/Z5HQWsc3ZcPe3BJN/awATCWuR9jbIdPa0ddn0CplYoOoWsfxSkd8+ogi6nef5FiZsFtgZyRArCIEmK2xjBmEVouSPbW+E5hGmkQ33SCtymyTrppZVBTEiC69/DC3SoIrgoIZMGVCsfYy4kSd7JwT+NibKG/v74ZQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from TYZPR06MB6697.apcprd06.prod.outlook.com (2603:1096:400:451::6) by TYZPR06MB4205.apcprd06.prod.outlook.com (2603:1096:400:2e::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6433.22; Tue, 30 May 2023 07:27:00 +0000 Received: from TYZPR06MB6697.apcprd06.prod.outlook.com ([fe80::f652:a96b:482:409e]) by TYZPR06MB6697.apcprd06.prod.outlook.com ([fe80::f652:a96b:482:409e%5]) with mapi id 15.20.6433.018; Tue, 30 May 2023 07:27:00 +0000 From: Lu Hongfei <luhongfei@vivo.com> To: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>, Liam Girdwood <lgirdwood@gmail.com>, Peter Ujfalusi <peter.ujfalusi@linux.intel.com>, Bard Liao <yung-chuan.liao@linux.intel.com>, Ranjani Sridharan <ranjani.sridharan@linux.intel.com>, Daniel Baluta <daniel.baluta@nxp.com>, Kai Vehmanen <kai.vehmanen@linux.intel.com>, Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>, sound-open-firmware@alsa-project.org (moderated list:SOUND - SOUND OPEN FIRMWARE (SOF) DRIVERS), alsa-devel@alsa-project.org (moderated list:SOUND - SOC LAYER / DYNAMIC AUDIO POWER MANAGEM...), linux-kernel@vger.kernel.org (open list) Cc: opensource.kernel@vivo.com, luhongfei@vivo.com Subject: [PATCH] sound: Fix incorrect calculation of object size by sizeof Date: Tue, 30 May 2023 15:26:48 +0800 Message-Id: <20230530072648.13998-1-luhongfei@vivo.com> X-Mailer: git-send-email 2.39.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: TYXPR01CA0052.jpnprd01.prod.outlook.com (2603:1096:403:a::22) To TYZPR06MB6697.apcprd06.prod.outlook.com (2603:1096:400:451::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYZPR06MB6697:EE_|TYZPR06MB4205:EE_ X-MS-Office365-Filtering-Correlation-Id: f40ae8b6-a380-4ac1-3320-08db60df4151 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Wk9XLz5EXIMUaO+tr6FAFl435dg0WaIkeTk0gsbLt2+yY0fdcEcBqXzOWLVeLDfW+jwTSRPuWWUuM1911NMeFo57mCozD0Vi51dJJKgXpP3BzReHmVVsopzuL+F8U2vpikAXpgDZd/lWmASJbVC4ToS9yauKQYgDH62X8Gk1AW044zMQOPw3k6ohbP7nRB9+L9V/p7o7Y32cgnvduRuPQhXclErxkGb+Klt+tHhu+P/XDU1ubRSMKcFCgugzzdhN7kPO/pbuV+DY4h3ZD4/W6hQNTZzOfYXaStrpCA+JBz5jPPuIwlViI2OqnwhbABRTvVanBIbn9HJrkyO0aMCINT9JIqT3oIC86G8OQPg0HufkZq4HnVz7uVEG8+TgD57Ks7LKzp0v+8OqZHyRmFxLBDRWEC0MHWjd61o5uaIl3HDWDxC9r5SKTjfblWF6UOjik7mT2uq5Q3QHaNK3Lz6TkmTy0MEHuR4MLhK2aUraqDAHhj2D9wlXquwTK0M3ciX2FRv7hMY2JPC6InHxEqo281gKWOeQftZ6fzuldpJYyuXdJqFWxKH5V6GsHeVv+IWK5g69sOY0rSliMRf/TMCx92l5GdCLehGJ2ldg9xw80drpEHpEWLcsNppd3Qlw8a0U X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:TYZPR06MB6697.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(346002)(366004)(376002)(396003)(136003)(39850400004)(451199021)(478600001)(110136005)(5660300002)(7416002)(4744005)(8936002)(8676002)(2906002)(86362001)(36756003)(4326008)(66556008)(66946007)(66476007)(316002)(921005)(38100700002)(38350700002)(41300700001)(2616005)(107886003)(186003)(6512007)(26005)(1076003)(6506007)(6486002)(52116002)(6666004)(83380400001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: q+kW9mJJ9GrXsj4igNeSrlSt9SJmFAM7BGcFc8IHcFo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WVHgGfkXsvmBNmPNmht/NENrB2fuAmGtUu7jNkaNhJ8edz7rklemASawMV8XTIVclpCGktcrzsDkNtTQjLstu+J7Y7woCkib/5preKPKGBQadGa17D+Fhejl01/MYPs9ZC8CBREhJkdkMiZW6L9A6KW/hBmomzKELyeeKokJVF/Xs76tunjhu1Lr7R4qTwzhh3eCT79ZXq0d0brqVNkIrYHhrQwOmsaSDW2YLgZDg+vyp2EPBNAgfHMyCr7LzsvFWVG9BdqpolPEzpWlCtdIm/3knag5ffstGwUE2FsvQn7clQCrJSYw9GmwJCpIkF+LEw/YyLqYFcd0vTIolNN6Pmi+r6swC+sEXDSEnlV+5Mb6IuDKVkk6fP3jEPrwwA2kk0xUPqUMcbZSLgx8GGkFGIVPpAzrBhj+YTgjPUk13DLMfVC1TqdrSoujdvZdJt9jkdDpKtckWd7pANgrzWIbsaTAM2OY8JlwLHcpWr0b0IXcMCRqZqxel2SzN0GM X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: f40ae8b6-a380-4ac1-3320-08db60df4151 X-MS-Exchange-CrossTenant-AuthSource: TYZPR06MB6697.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 May 2023 07:26:59.8249 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 1hH75LlhprBj4n9rNx0LlJ+Ij1bo0c8ACmGwNYu4mvbpZ5BqzLjYbvpWtFa+126GjD2UZb4viQfz9yDzzU+3/w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYZPR06MB4205 X-MailFrom: luhongfei@vivo.com X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1 Message-ID-Hash: X5QXWJ3J4MNSA7NY73DEBCQC3HXJPYF2 X-Message-ID-Hash: X5QXWJ3J4MNSA7NY73DEBCQC3HXJPYF2 X-Mailman-Approved-At: Thu, 01 Jun 2023 16:02:26 +0000 X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" <alsa-devel.alsa-project.org> Archived-At: <https://mailman.alsa-project.org/hyperkitty/list/alsa-devel@alsa-project.org/message/X5QXWJ3J4MNSA7NY73DEBCQC3HXJPYF2/> List-Archive: <https://mailman.alsa-project.org/hyperkitty/list/alsa-devel@alsa-project.org/> List-Help: <mailto:alsa-devel-request@alsa-project.org?subject=help> List-Owner: <mailto:alsa-devel-owner@alsa-project.org> List-Post: <mailto:alsa-devel@alsa-project.org> List-Subscribe: <mailto:alsa-devel-join@alsa-project.org> List-Unsubscribe: <mailto:alsa-devel-leave@alsa-project.org> |
Series |
sound: Fix incorrect calculation of object size by sizeof
|
expand
|
diff --git a/sound/soc/sof/ipc4-topology.c b/sound/soc/sof/ipc4-topology.c index 5abe616a2054..29b6dede53b0 --- a/sound/soc/sof/ipc4-topology.c +++ b/sound/soc/sof/ipc4-topology.c @@ -220,7 +220,7 @@ static int sof_ipc4_get_audio_fmt(struct snd_soc_component *scomp, ret = sof_update_ipc_object(scomp, available_fmt, SOF_AUDIO_FMT_NUM_TOKENS, swidget->tuples, - swidget->num_tuples, sizeof(available_fmt), 1); + swidget->num_tuples, sizeof(*available_fmt), 1); if (ret) { dev_err(scomp->dev, "Failed to parse audio format token count\n"); return ret;
What we need to calculate is the size of the object, not the size of the pointer. This patch can fix this error. Signed-off-by: Lu Hongfei <luhongfei@vivo.com> --- sound/soc/sof/ipc4-topology.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 sound/soc/sof/ipc4-topology.c