Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp1747832lqg; Mon, 4 Mar 2024 02:30:08 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVyYUkKiYXlU5eWONr6t6QKKJwNribQ9tYxdZrh9FMC3iJ8GY5er8WI2hul+4nktOnRkinVZ7bgMs7BjdvG3cukQtDSSMvPf7dJD2nVgQ== X-Google-Smtp-Source: AGHT+IHe/eddXeSckfSflrl8C56Oy+R0171o1xoTBTz5ajdnBXmkxxpb6W5r8ZgoM3vhN8DGWSYx X-Received: by 2002:a17:903:41ca:b0:1dd:1c6f:af4f with SMTP id u10-20020a17090341ca00b001dd1c6faf4fmr1239849ple.55.1709548208745; Mon, 04 Mar 2024 02:30:08 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709548208; cv=pass; d=google.com; s=arc-20160816; b=Nl8vCcUewfana+FOdFPu0pnU6/EEJ/F+rXkPMxYwP1ybSZt3h0+h3nZfZ9iHJsiy+Z 8MBWx5sJGUflw7qomIx3tfE+dcqPnDbhHnCTplNlfH8PvxyUkIjX647L9sfoikGhyLQz /4g71pzhRZTsx5xMvebkjeGZZmMORgOQ+IAOXcxWP1WALlgOjl/kmRd6FFkj5k7G1srM qqfy8frEautswof8Bo/OXuyRRzAoTpQ/uRCY3xBxmDycJ3DvOhml+KOAntSDPPpw+wmE Bj/GvQuid0IuLfKrusEEP4y+UoXItm8WRcDqF2hWCoXnS8CaAbj+5ZbfeDlaffso58sX GfEw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=feedback-id:content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from; bh=wDCIItz+0nHA+M7cX6cAlyye8JMgE2GXsEktMuU7ymU=; fh=Btw1EmUMH8ZppTk63lXKLcBmX2SRPrhs65VkxzxfFfY=; b=J22pb22dhUhGNlifihV+jIsb8cWE3mFbkXP0ToxTxDACA/w9m/hWqEaWJAXAFVCEBY 3cO7hkQT7YZRu10HEeWwI7sNC0XphieL0L0s5RzqIVdUiM1ORwhJ27QtK/VjIAi24OGf 8upmHpDSo51qEh9T3UR74vdWYG/uh6nfhCCwRo1emJ9XtmRqlOT9D/HvvE2rdelAnA+5 n1uVWXECV4iC6HfGB3VfllHl7namOcN4DARyco/99jqt0thaV0p5pjjO2zmMLL+qRS+I 0F8Ck9bkL5az7JvV8GRlPA6GznTLC66Rnvzl13EJPpql0l/WIKdjdlAfrEZvQZT2F3ly FJBA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=shingroup.cn dmarc=pass fromdomain=shingroup.cn); spf=pass (google.com: domain of linux-kernel+bounces-90416-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-90416-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=shingroup.cn Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id d7-20020a170902654700b001dbfaa6d483si7945712pln.595.2024.03.04.02.30.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Mar 2024 02:30:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-90416-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=shingroup.cn dmarc=pass fromdomain=shingroup.cn); spf=pass (google.com: domain of linux-kernel+bounces-90416-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-90416-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=shingroup.cn Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id EB30DB24E70 for ; Mon, 4 Mar 2024 10:20:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 708EB225A6; Mon, 4 Mar 2024 10:18:53 +0000 (UTC) Received: from bg1.exmail.qq.com (bg1.exmail.qq.com [114.132.67.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C2F76225CB for ; Mon, 4 Mar 2024 10:18:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=114.132.67.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709547533; cv=none; b=iXtp+PNw0wJ1KFWuZAeFHY1C7RFaMVNqrImrpvcbuBXodaMGg08VQVsvj7dzE6SGToPyfXCwdhoEWP6ECMGrfM/1CxTEWbOwD6VLINlI8gq/jGqEBQU0ZIRGWRdl5YKKtEZ5qgkykkoqlWzklAR4LkOEZMlwPDhT9ImAfOAymqI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709547533; c=relaxed/simple; bh=dpj4ufgifj7GIAYt7yGK4hK+qv6CPi//o/CWx5UlmNo=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=P1HRHfBYLeNcdVKlthrCHuG4kEyoDe10aIFRvbav3szshQOvXavYW1F05ZAzZTVvrw4+/FeH+PuA5QbooMlzHsaA++4CJ5PYpkqTnWt3J3tcApZQ0aQFjkQGev6j7XrDCQ68YKkIffnKRTQ4AlEti0KpMf9SoZgm3UKmtRAhGng= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=shingroup.cn; spf=pass smtp.mailfrom=shingroup.cn; arc=none smtp.client-ip=114.132.67.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=shingroup.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=shingroup.cn X-QQ-mid: bizesmtp62t1709547436tgx9g8d8 X-QQ-Originating-IP: 5APuCEWtsWVVSMzxS98Vxt66O3rkkYqE//ZKcb3vJ+g= Received: from localhost ( [112.22.30.30]) by bizesmtp.qq.com (ESMTP) with id ; Mon, 04 Mar 2024 18:17:15 +0800 (CST) X-QQ-SSF: 01400000000000505000000A0000000 X-QQ-FEAT: K2/klV1qoGlTWfl/w1BagxXdSiRmYm4VevULtmbJrZ7m+uuFIYP55sr8PKkvE LFZQXXHCr2EtSCCK5SmQK1O3CRe7068aVPwYQHDZCMfx7QBCLRqh9MtFSaXOyEVk4S+IfnL 2/c6rzZrUKUayJFC/T2TuxVOdQKJPK4MvcEOso17dcNqbz53yLtACjYbYOWZKrry9iwT4rK XzDZJLmzJEfCUTJb7aJM8LZ5wN7nvXIEDScRqEYoc9zVus6PtEhY12m8BHXaIfrp3UvkIuq UmrF6GqiRFa+hiBGw0LgRdJa9CPzsujyNW9C5ZPnUspyt0oTr42TjiB9UjisUspC6pYOJY+ VID4BefrRwRQu91VAot+KD4yuNquhwGHqQx/zo6dV5tqUydf5QcwodVxY4LKfdFhmVkUqnD 1lKiJBNLonDN+eqHPG21JpBfAZ4tTl0e X-QQ-GoodBg: 2 X-BIZMAIL-ID: 11784876487773860519 From: Dawei Li To: conor.dooley@microchip.com, daire.mcnamara@microchip.com Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Dawei Li , kernel test robot Subject: [PATCH v2] firmware: microchip: Fix over-requested allocation size Date: Mon, 4 Mar 2024 18:16:53 +0800 Message-Id: <20240304101653.126570-1-dawei.li@shingroup.cn> X-Mailer: git-send-email 2.27.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:shingroup.cn:qybglogicsvrgz:qybglogicsvrgz5a-1 cocci warnings: (new ones prefixed by >>) >> drivers/firmware/microchip/mpfs-auto-update.c:387:72-78: ERROR: application of sizeof to pointer drivers/firmware/microchip/mpfs-auto-update.c:170:72-78: ERROR: application of sizeof to pointer response_msg is a pointer to u32, so the size of element it points to is supposed to be a multiple of sizeof(u32), rather than sizeof(u32 *). Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202403040516.CYxoWTXw-lkp@intel.com/ Signed-off-by: Dawei Li --- V1 -> V2: sizeof(u32)->sizeof(*response_msg) V1: https://lore.kernel.org/lkml/20240304092532.125751-1-dawei.li@shingroup.cn/ drivers/firmware/microchip/mpfs-auto-update.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/firmware/microchip/mpfs-auto-update.c b/drivers/firmware/microchip/mpfs-auto-update.c index 682e417be5a3..fbeeaee4ac85 100644 --- a/drivers/firmware/microchip/mpfs-auto-update.c +++ b/drivers/firmware/microchip/mpfs-auto-update.c @@ -384,7 +384,8 @@ static int mpfs_auto_update_available(struct mpfs_auto_update_priv *priv) u32 *response_msg; int ret; - response_msg = devm_kzalloc(priv->dev, AUTO_UPDATE_FEATURE_RESP_SIZE * sizeof(response_msg), + response_msg = devm_kzalloc(priv->dev, + AUTO_UPDATE_FEATURE_RESP_SIZE * sizeof(*response_msg), GFP_KERNEL); if (!response_msg) return -ENOMEM; -- 2.27.0