Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1401417ybh; Thu, 23 Jul 2020 08:03:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw5qSzjDmeIJWcopv4leMD3/Wt0xHVduCsf59i6aGw48+avXWu6jKuZf9oSmmN4NJ5ivZcv X-Received: by 2002:a17:906:7e04:: with SMTP id e4mr5032557ejr.83.1595516590155; Thu, 23 Jul 2020 08:03:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595516590; cv=none; d=google.com; s=arc-20160816; b=anr6USPNpursfD0I0s2LCpOYsu+AQI1ED7BI6lZ+ddtYyqlMKHOg24wISfY+/6pXD0 TyF7nb206dkQbUEC7E0Q5cge9WfrU+hU+uljkGXPBn15b5KtBSsRiaVL/yrcFVZJgobZ V0FZZ6ESqcZzYtYeJW7/li80RiMselJtgO3Dxr0QOYdwx5W3LQfvGBlu+i8UOrU3qCbV h/FOCgVsDRdsvKph45ith0dkCMESaWcFBhdE8SKwlQKmgdoqU7o7ZHGoN7U5tmjlL0m/ ev3FgvWBcoYlVyzgfELFVymY9+uWCH1K5JNESOp2UwIf7N8Jur5EEuhZl5SJM7k814nq ViNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :ironport-sdr:ironport-sdr; bh=p40qs0uz4na3lsOoanqrxRjVNKT1GAwcE+a1O4nEQ3A=; b=FOilsTqO6+OjbS0/tYzgTlo6KW+0SoQSeeuFFUk1Tkvye9z/Q6D7iFkZ+Z3mxpqxlB 7AQzBNWu8dvG4sy2+Csq6V3Uml6Sqyw0Q7X3NuqdWqo2jrT1JjIXxO3BlvL2DeAJZLrR h3KSQSgu7GoXR8lpKoTfHXIS1JuNnXRDvOSOHGbO609kRNS/MIZieJwzBU/prvRpb6OZ vXtp04iCuc7dsQtFtQH12/oM/Z926hhRMtqys8lgK2pvHurelzrHAB5EfKN5wjnTETTz Oh06h1zK8Gzu3ayz7LyAR7p6U+ie8jNWFovAgPSERpdv2ElhJcwRgYVHyKRTGwK/cXbk sXlQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c18si1273220eds.417.2020.07.23.08.02.44; Thu, 23 Jul 2020 08:03:10 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729529AbgGWO7u (ORCPT + 99 others); Thu, 23 Jul 2020 10:59:50 -0400 Received: from mga09.intel.com ([134.134.136.24]:50088 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729471AbgGWO7r (ORCPT ); Thu, 23 Jul 2020 10:59:47 -0400 IronPort-SDR: kmbRv2b1ApX5x6PWsy+YORO6zoI1nfNpbcW8d9twlfY3ar1auo5X4ElfBypkDuo0sVPTcybw4M 4qP1BGq48SYQ== X-IronPort-AV: E=McAfee;i="6000,8403,9690"; a="151839035" X-IronPort-AV: E=Sophos;i="5.75,386,1589266800"; d="scan'208";a="151839035" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Jul 2020 07:59:47 -0700 IronPort-SDR: gwpzmg9c53jfxnnX6yQrdjYo1MydZpLxCQ96VsUjluu4n7XeLRknM7J/jfvewWqyL19bprePu7 ds++qHE2MgcQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,386,1589266800"; d="scan'208";a="311051210" Received: from twinkler-lnx.jer.intel.com ([10.12.91.138]) by fmsmga004.fm.intel.com with ESMTP; 23 Jul 2020 07:59:45 -0700 From: Tomas Winkler To: Greg Kroah-Hartman Cc: Alexander Usyskin , linux-kernel@vger.kernel.org, Tomas Winkler , "Gustavo A . R . Silva" , Arnd Bergmann Subject: [char-misc-next 4/6] mei: client: use sizeof of variable instead of struct type Date: Thu, 23 Jul 2020 17:59:25 +0300 Message-Id: <20200723145927.882743-5-tomas.winkler@intel.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20200723145927.882743-1-tomas.winkler@intel.com> References: <20200723145927.882743-1-tomas.winkler@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org There is a possibility of bug when variable type has changed but corresponding struct passed to the sizeof has not. Cc: Gustavo A. R. Silva Signed-off-by: Tomas Winkler --- drivers/misc/mei/client.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/misc/mei/client.c b/drivers/misc/mei/client.c index b32c825a0945..2572887d99b6 100644 --- a/drivers/misc/mei/client.c +++ b/drivers/misc/mei/client.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 /* - * Copyright (c) 2003-2019, Intel Corporation. All rights reserved. + * Copyright (c) 2003-2020, Intel Corporation. All rights reserved. * Intel Management Engine Interface (Intel MEI) Linux driver */ @@ -369,7 +369,7 @@ static struct mei_cl_cb *mei_io_cb_init(struct mei_cl *cl, { struct mei_cl_cb *cb; - cb = kzalloc(sizeof(struct mei_cl_cb), GFP_KERNEL); + cb = kzalloc(sizeof(*cb), GFP_KERNEL); if (!cb) return NULL; @@ -552,7 +552,7 @@ int mei_cl_flush_queues(struct mei_cl *cl, const struct file *fp) */ static void mei_cl_init(struct mei_cl *cl, struct mei_device *dev) { - memset(cl, 0, sizeof(struct mei_cl)); + memset(cl, 0, sizeof(*cl)); init_waitqueue_head(&cl->wait); init_waitqueue_head(&cl->rx_wait); init_waitqueue_head(&cl->tx_wait); @@ -575,7 +575,7 @@ struct mei_cl *mei_cl_allocate(struct mei_device *dev) { struct mei_cl *cl; - cl = kmalloc(sizeof(struct mei_cl), GFP_KERNEL); + cl = kmalloc(sizeof(*cl), GFP_KERNEL); if (!cl) return NULL; -- 2.25.4