Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1283222pxu; Mon, 23 Nov 2020 17:01:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJxCFqbdOcS72rvVm4tSTWfs6c/upSJZ4l4y+89tGpcmAinA1KWar1evcWE57F18g1bUk9Vo X-Received: by 2002:a17:906:3813:: with SMTP id v19mr2092152ejc.462.1606179698287; Mon, 23 Nov 2020 17:01:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606179698; cv=none; d=google.com; s=arc-20160816; b=rWynFTb9L7ttJ8waGHGY8YMZCgGDwLsa66qmMM4BflpRXAMSRAfi4aj8Q1Bvkm4muR U23zaAFRms75VbxgOgrJKh0/qSNn3noLiz0EvdcYxOcailN3SA6Zuy6stAFBloCjUEUn e3L9E9aMUVOUnGkv8MZNolqlCj6gmrlluBGOVbAVECpcL8dDiIoBQdZhCi9i9qc3irZZ s8uHrnKur00iencaKMKEz396avqoCd1LFqpOjMDyGo0DAcRX1YvdoI1mRhOixlXmq+QE XFZAbxKE+iTficRMHkuYrmEeVEpSHqEOyeZti5YKiTBOFMG55N4yRV7ccxjvBB0wY11/ mKgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:to:from; bh=JCjbzadONh5UR+k1HikM4EaK5GAsIfKnpS5eD/EnrFA=; b=QVCaHME6+BT81L5anCzvrjrxfhUvtm8Ws0z2MxmTcA1YUWboHfgxnHbgSoYKbcH//K fi+u+Wn6Vjd6Dry7xNHuXtevni3YN0bFg0rqXyEA+lahxFeO543OHA1WMTnRxbZ0ChbR G8ROLGeGmBGG6I9EL8mz4xRLRPk7IaJV+4/V0s/3Jp/kxG0lapJlVMlav8geSmKNki9d bCM52UdZ/gmI0yPJaxLqKAa3R6HkwFerioGdvwU4W0K/OMNWFN/H88TxG/E3tsFEsnRv x35hmQq92tEydkM93wtqf4I6f6QMJXMQu9kHE+BRr1T+eq/jY6JoayqL8Tfpi3xvx922 cPcQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t22si5334456edi.570.2020.11.23.17.01.15; Mon, 23 Nov 2020 17:01:38 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728654AbgKXA6a (ORCPT + 99 others); Mon, 23 Nov 2020 19:58:30 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:7968 "EHLO szxga06-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726803AbgKXA63 (ORCPT ); Mon, 23 Nov 2020 19:58:29 -0500 Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4Cg5H83ywWzhdtc; Tue, 24 Nov 2020 08:58:12 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id 14.3.487.0; Tue, 24 Nov 2020 08:58:23 +0800 From: Tian Tao To: , , , Subject: [PATCH] firmware/psci: psci_checker: fix application of sizeof to pointer Date: Tue, 24 Nov 2020 08:58:45 +0800 Message-ID: <1606179525-63938-1-git-send-email-tiantao6@hisilicon.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org sizeof when applied to a pointer typed expression gives the size of the pointer. The proper fix in this particular case is to code sizeof(*cpu_groups) instead of sizeof(cpu_groups). This issue was detected with the help of Coccinelle. Signed-off-by: Tian Tao --- drivers/firmware/psci/psci_checker.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/firmware/psci/psci_checker.c b/drivers/firmware/psci/psci_checker.c index 9a369a2..116eb46 100644 --- a/drivers/firmware/psci/psci_checker.c +++ b/drivers/firmware/psci/psci_checker.c @@ -155,7 +155,7 @@ static int alloc_init_cpu_groups(cpumask_var_t **pcpu_groups) if (!alloc_cpumask_var(&tmp, GFP_KERNEL)) return -ENOMEM; - cpu_groups = kcalloc(nb_available_cpus, sizeof(cpu_groups), + cpu_groups = kcalloc(nb_available_cpus, sizeof(*cpu_groups), GFP_KERNEL); if (!cpu_groups) { free_cpumask_var(tmp); -- 2.7.4