From patchwork Mon Dec 23 16:28:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ethan Carter Edwards X-Patchwork-Id: 13919165 Received: from mail-10627.protonmail.ch (mail-10627.protonmail.ch [79.135.106.27]) (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 4DFD71B6CFE for ; Mon, 23 Dec 2024 16:28:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=79.135.106.27 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734971304; cv=none; b=YZ0JrY2yqVS46PiHCIp1lJhBXYJuCRciMjuVan8H7H/y0oXkMDmCfzI75PkBJ+jjWdVMd4hJnutOEfXchT7awJX05GhJ00KiCamq/cWOLLj6Zu4nJlFAVMKwSanthcCjNV6PeVGzdzq9oYmGSAmRqOL1jAj+VnTgYIPEAtT/oqU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734971304; c=relaxed/simple; bh=YwniGKnAg4EDmwYBiUYaoSDvo6SUYsXGJQgDPG4yMSE=; h=Date:To:From:Cc:Subject:Message-ID:MIME-Version:Content-Type; b=enZB6T1YQwwkSgxusKPOmDdxvV8kD3jCFXmGVYOmUDRZ4OXyFzjZoqE81vozTzlLP1JAKNh1/iMA5fJz1pJcfFNq3fnd9yKbz9XppLyr374w1FQ3LKlChvfUDQp2B0NmdDUFBHpwJuw1L3/BQ06xRIyVYFnp9vNsyC7u6zWOBTA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ethancedwards.com; spf=pass smtp.mailfrom=ethancedwards.com; dkim=pass (2048-bit key) header.d=ethancedwards.com header.i=@ethancedwards.com header.b=dKhJz62U; arc=none smtp.client-ip=79.135.106.27 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ethancedwards.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ethancedwards.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ethancedwards.com header.i=@ethancedwards.com header.b="dKhJz62U" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ethancedwards.com; s=protonmail3; t=1734971294; x=1735230494; bh=bqyMZPUwM8jdoQ7R6OfI9h6Twr/FyoQIi75Q+q7W9u4=; h=Date:To:From:Cc:Subject:Message-ID:Feedback-ID:From:To:Cc:Date: Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector: List-Unsubscribe:List-Unsubscribe-Post; b=dKhJz62UltxDlEmpJaPB4/KU5pncU8BXKp64nZSktCoyu/p2SxGL/p6GJpNE+niVM oRTB6rnkEDxmmsmUR26ZKa7rx4G5gMHFNNYG1jmZCQJV1j3uAyYOLrg0nnXiVGQbDg uBrJVPK+TDnUpBmeW+AZK6tB0Q1bmA+R35d0U1jSf6EJlRN6MyUbjlWv2Mn8OG11eQ r7eWB6KuwZlt51nk/OU7MIERljnMPVX34wr7tabRX/v0mbScPuoxmLBzDBUcVfzww8 QwNbJIK/88VBZ7bj63gGpgObQkEzDPpHV/+uE+Et5eWYk48xb9xp2xxkBTFj0VLehv 40ntThRWXFv+g== Date: Mon, 23 Dec 2024 16:28:09 +0000 To: "rafael@kernel.org" From: Ethan Carter Edwards Cc: "daniel.lezcano@linaro.org" , "linux-pm@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "kernel-hardening@lists.openwall.com" , "linux-hardening@vger.kernel.org" Subject: [PATCH v2] thermal/debugfs: change kzalloc to kcalloc Message-ID: Feedback-ID: 28410670:user:proton X-Pm-Message-ID: 7953223c63a835d43bd4e9b315c0fdf4d734ad51 Precedence: bulk X-Mailing-List: linux-hardening@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Use 2-factor multiplication argument form kcalloc() instead of instead of the deprecated kzalloc() [1]. [1] https://www.kernel.org/doc/html/next/process/deprecated.html#open-coded-arithmetic-in-allocator-arguments Link: https://github.com/KSPP/linux/issues/162 Signed-off-by: Ethan Carter Edwards --- drivers/thermal/thermal_debugfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.47.1 diff --git a/drivers/thermal/thermal_debugfs.c b/drivers/thermal/thermal_debugfs.c index c800504c3cfe..29dc1431a252 100644 --- a/drivers/thermal/thermal_debugfs.c +++ b/drivers/thermal/thermal_debugfs.c @@ -876,7 +876,7 @@ void thermal_debug_tz_add(struct thermal_zone_device *tz) tz_dbg->tz = tz; - tz_dbg->trips_crossed = kzalloc(sizeof(int) * tz->num_trips, GFP_KERNEL); + tz_dbg->trips_crossed = kcalloc(tz->num_trips, sizeof(int), GFP_KERNEL); if (!tz_dbg->trips_crossed) { thermal_debugfs_remove_id(thermal_dbg); return;