From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3BEAFC63798 for ; Wed, 25 Nov 2020 14:05:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E6A5420684 for ; Wed, 25 Nov 2020 14:05:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729909AbgKYOFh (ORCPT ); Wed, 25 Nov 2020 09:05:37 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:39456 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725792AbgKYOFg (ORCPT ); Wed, 25 Nov 2020 09:05:36 -0500 Received: from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1khvQB-0000Hp-Df; Wed, 25 Nov 2020 14:05:23 +0000 From: Colin King To: Barry Song , Christoph Hellwig , Marek Szyprowski , Robin Murphy , iommu@lists.linux-foundation.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] dma-mapping: Fix sizeof() mismatch on tsk allocation Date: Wed, 25 Nov 2020 14:05:23 +0000 Message-Id: <20201125140523.1880669-1-colin.king@canonical.com> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Colin Ian King An incorrect sizeof() is being used, sizeof(tsk) is not correct, it should be sizeof(*tsk). Fix it. Addresses-Coverity: ("Sizeof not portable (SIZEOF_MISMATCH)") Fixes: bfd2defed94d ("dma-mapping: add benchmark support for streaming DMA APIs") Signed-off-by: Colin Ian King --- kernel/dma/map_benchmark.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/dma/map_benchmark.c b/kernel/dma/map_benchmark.c index e1e37603d01b..b1496e744c68 100644 --- a/kernel/dma/map_benchmark.c +++ b/kernel/dma/map_benchmark.c @@ -121,7 +121,7 @@ static int do_map_benchmark(struct map_benchmark_data *map) int ret = 0; int i; - tsk = kmalloc_array(threads, sizeof(tsk), GFP_KERNEL); + tsk = kmalloc_array(threads, sizeof(*tsk), GFP_KERNEL); if (!tsk) return -ENOMEM; -- 2.29.2