Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1097052pxb; Thu, 19 Aug 2021 20:25:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzpwdQPD0XRbfi0h7oDVitTTOmc9qLmGTvpUzkuoSXgtb8sKfwgXksf4HrqAlJQkReDV/4H X-Received: by 2002:a05:6402:51cb:: with SMTP id r11mr20173085edd.270.1629429924829; Thu, 19 Aug 2021 20:25:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629429924; cv=none; d=google.com; s=arc-20160816; b=x9+mx+QIS3fNabXVdIqMNHScYd0++VjD7vfQl5zCxEs6pIo1I5viFwhH4jPDepRs7k jrgQOM76BTQVVssmW/IpE9OKh71U4eSzXJy/Aod8ewybg0kIsBtOv9iDcR6CtiMwks7M Hz219VQbTaW7KMZHNOuG+A4wxILLzob9U7GsrGQN9t6R/G4C0LtkWra3tq4LY4dk7rHp KpqhPQ6oKg2WkTuTUrwV0LR6SzRsyodC7nHv1u8o4qAlP0e2U8zbbH1OrDgQjp3xDoaR HPihUVpTH4huFMuADQH00PRKa/7+qk+mF4QrY67xCV1xL2TNq971t1+g033IoHLGF+vr S07w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=f+sJ+u/djA+XBJ3U0yapIkY+ojXYJJl4V8fhz0MLb2A=; b=zruPCENeCjZMBR4c/nIXZGysEOCaCs1JdxbcPlk2BNZhLCKZ9TCCg/+1WDw+HrYoG6 YR6D/7XFu0Lb5ZCG+n4W5HsqgGJsptGokjb7VLAAWc9nj5Kr5/Zx+ulGr6hu4tn5qFdp 4rDzYhHv4F15mZP07Rz5CZ5qJ2i73/Jnwze6OLsTrjQDYLicOZ0oJr5YVuFZx6FL8dak zuKuoiA9Bxyz0FOpEvwUB0o+QmMLvTmRdLZF/ONUXfAyBrDk0hMHh9YEQQkC+aXZJYLp Mi/w6aZmRFi23PhmGYFK/bopeR1np2bZGsU7GV8QiXzLfEglk261Isd01d6o+HbxOaXt 3csw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="a/UAlFYn"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i17si5228549ejd.15.2021.08.19.20.25.01; Thu, 19 Aug 2021 20:25:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="a/UAlFYn"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237933AbhHTDWM (ORCPT + 99 others); Thu, 19 Aug 2021 23:22:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51512 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234992AbhHTDWL (ORCPT ); Thu, 19 Aug 2021 23:22:11 -0400 Received: from mail-qt1-x836.google.com (mail-qt1-x836.google.com [IPv6:2607:f8b0:4864:20::836]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D4AFDC061575 for ; Thu, 19 Aug 2021 20:21:33 -0700 (PDT) Received: by mail-qt1-x836.google.com with SMTP id e15so6452832qtx.1 for ; Thu, 19 Aug 2021 20:21:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=f+sJ+u/djA+XBJ3U0yapIkY+ojXYJJl4V8fhz0MLb2A=; b=a/UAlFYntqRemgO3V0zoIS10A+s9hehi7XjVf42TP0S1KAGUMmW4RizBib2hEWGPZ3 ypowOxBJZORRA3ujSGxPyvyw43e5FHkF9P9RojAQrHXBIqTcJAQYPA2j/7HyQZfE9LIb 3E2XQJKl5D6Eek94nTTRkAUJTw5VYANQ9FixS0yQSkya6ZHqcndy8s/UCB76D0UqNKNi e9rzIQDEmZowBqhnFjYIKLgpc6W2MHMQ5suh33ZC4OwHKSah/Cg/IgQ+zGp9g9q5KFcg nUbodUdTYJwOu+d69Aigl+TzpF2NyRJh3U+VtdLm26+RzIDXNXdi4sKYbYqzH2pLREol I8+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=f+sJ+u/djA+XBJ3U0yapIkY+ojXYJJl4V8fhz0MLb2A=; b=qNyPpZKl4T4+o1C2ai0rvQRV4qBKVjogIvfI5BhdnY2bfQ82+Kvj+Pgp0YwTKbXP6h SmP61i6CaJ0ntr24ObS0OOnUdUyqCJE83ZQbP8BX9qpuWDKsvn3wYJn+N9Htm4V+2Ygt aWwGCBmFn/MnU7woWf58xsci+2jgBXGoQo8Y7oMUIZQuCwORZ4hOZrSwE59z28mpuz8x jZuoVW/wIsEegsDPhpTx5HQ7PVXs2aV2BWHuz5bmGrPLPo81WUxEAw3/AGtrhtaTyLld QiyjyIJh3cV1xhaZ2zIr7SbVrOf1E2O41sXElksjbR7NOX/p9BnQJfnZqre6kE07ZDoQ tRXA== X-Gm-Message-State: AOAM530xCagoTBNGChEHx7aMvzjxSdQGBaFKJg5qIolq4saGwZYep+e7 VM5BYnJzWFxtBluTtihNfzc= X-Received: by 2002:ac8:a0a:: with SMTP id b10mr15691200qti.164.1629429693126; Thu, 19 Aug 2021 20:21:33 -0700 (PDT) Received: from localhost.localdomain ([193.203.214.57]) by smtp.gmail.com with ESMTPSA id g2sm2437382qki.42.2021.08.19.20.21.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Aug 2021 20:21:32 -0700 (PDT) From: CGEL X-Google-Original-From: CGEL To: Jens Wiklander Cc: Sumit Garg , op-tee@lists.trustedfirmware.org, linux-kernel@vger.kernel.org, jing yangyang , Zeal Robot Subject: [PATCH linux-next] tee/optee/shm_pool: fix application of sizeof to pointer Date: Thu, 19 Aug 2021 20:21:27 -0700 Message-Id: X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: jing yangyang sizeof when applied to a pointer typed expression gives the size of the pointer. ./drivers/tee/optee/shm_pool.c:38:28-34: ERROR application of sizeof to pointer This issue was detected with the help of Coccinelle. Reported-by: Zeal Robot Signed-off-by: jing yangyang --- drivers/tee/optee/shm_pool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tee/optee/shm_pool.c b/drivers/tee/optee/shm_pool.c index c41a9a5..d167039 100644 --- a/drivers/tee/optee/shm_pool.c +++ b/drivers/tee/optee/shm_pool.c @@ -35,7 +35,7 @@ static int pool_op_alloc(struct tee_shm_pool_mgr *poolm, unsigned int nr_pages = 1 << order, i; struct page **pages; - pages = kcalloc(nr_pages, sizeof(pages), GFP_KERNEL); + pages = kcalloc(nr_pages, sizeof(*pages), GFP_KERNEL); if (!pages) { rc = -ENOMEM; goto err; -- 1.8.3.1