Received: by 2002:ab2:5d18:0:b0:1ef:7a0f:c32d with SMTP id j24csp65524lqk; Sat, 9 Mar 2024 00:24:56 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWWFCLKyaYAykTbNWhHKI2gF4KuC/k3b7k1nPZprxCigcjsQI3IFRqufKuUyEwjL9IU+scRCUn4huASP2UHyVWpepNn++dTsMrElX2CqQ== X-Google-Smtp-Source: AGHT+IE0Z5gz04IQqxR2v2ppBDooEjTsvtj8Nlxu5TkxfZC1vAqMlC6UISYi5ofuSbwhc/4V2IZi X-Received: by 2002:a17:907:c80c:b0:a3e:c818:b7f with SMTP id ub12-20020a170907c80c00b00a3ec8180b7fmr1076632ejc.29.1709972696010; Sat, 09 Mar 2024 00:24:56 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709972695; cv=pass; d=google.com; s=arc-20160816; b=bC6C7d5L7BLTEBnQzkInaP3Gug1e2bJrFEw9eaxYzzpB6m2xycL1b9uQAeGLHZ+a8G IWURX2uzwJswAECpjIaaakslRjeg28GvMWdeaoV0GK+Awj+KEXMRmGrtv1exC9rG7FaP KrkJlOTe+h7U5Ac8e3aIPjLt5HXhNS9d3AoNPTEVNz1eVod9S3tmgt2mD9Wh9Cr37JBh 3A9aZanU8KO3gI4e0/8xF8OiLEQTCKUNxmwgLCwS+rJ/Q/bOmklEwOD4COUuCnRrzSpn OHppKbWdbAegFFS9lXg75of3pCD2aWBH8JpS6IyM+Z4vxv2PATVT/sIy0QIxHquUyV/i CzUg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=gVcBB4b2goouePWzmRKHvoTzqcQB5Oy5FKzQOYSOsEo=; fh=xIe6WxxPiEV/Na/88r0K3EUJXgvV4J8CJNefWoKdWD4=; b=GQx2err30zIKX8E2cCEOTyH+0qeeE0gHxgWsUijhRRUZAfjLqvw9H9Q6csPQ4tt4QV McJ27S8cIxd/xpbsQpFX3PzG1VXoSYr+TefY3ExdkISbNnOTg5gS4HO4sXXG5nBDs2wK iK4boH5bI0Cxdy+guM7j0SqnNXClM93NXH+2IXrjRj6KwgDaVKVAde+2pE2bNlQzPEdb OW+xuajH3atQwRiufzMlCmuT0xk8V2PZnVUI2MCRP1J03SExW05S3utEJFhsL2LRdCDf zZaPytWsqjWKkJ9zzcya6yc2vEro+G4smuRvZ+XGQnAIiy6ujne9WB01yBvK0TD6Ld6C cifg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=GC1Kgc0o; arc=pass (i=1 spf=pass spfdomain=wanadoo.fr dkim=pass dkdomain=wanadoo.fr dmarc=pass fromdomain=wanadoo.fr); spf=pass (google.com: domain of linux-kernel+bounces-97807-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-97807-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=wanadoo.fr Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id t13-20020a1709064f0d00b00a45e382d300si556729eju.638.2024.03.09.00.24.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Mar 2024 00:24:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-97807-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=GC1Kgc0o; arc=pass (i=1 spf=pass spfdomain=wanadoo.fr dkim=pass dkdomain=wanadoo.fr dmarc=pass fromdomain=wanadoo.fr); spf=pass (google.com: domain of linux-kernel+bounces-97807-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-97807-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=wanadoo.fr 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 am.mirrors.kernel.org (Postfix) with ESMTPS id AC4B61F217DE for ; Sat, 9 Mar 2024 08:24:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A7782374EB; Sat, 9 Mar 2024 08:24:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b="GC1Kgc0o" Received: from smtp.smtpout.orange.fr (smtp-20.smtpout.orange.fr [80.12.242.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C25F42C869 for ; Sat, 9 Mar 2024 08:24:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=80.12.242.20 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709972687; cv=none; b=De+D5A18jdN1RWO7IgqCB5z5jZhENy6lJbdLp53oydHrAnc1FqLqVOGqpNhbhdbQSEsVU2iUw7H+TIYyFfjJV2B0JwKSehP9DibZiZwLSv5j6GGqQtG3LQc6eiY5+92yUj0mPYoNwdOSx9gdo3Ww4wFm7Ei4PkpB4fgYRif9HTg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709972687; c=relaxed/simple; bh=7tkM/0JbbXyVkdtIU4Si0Icg1L/BSNtCJO0oOS2f124=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Xui/VjljItjaOfagL2wRq9MtKulI4aI/QI59mLANOHRxR2clf/SXT1eOH1Q9T6nUivFhlmnUbNNm1YTk/hOssvw7wZs8fiqnU7czr6C4PIkmOgWfuOsbgClRAzo7jZSPlP8tQXXHWbmndOgESLtnVVdsGEjfBREaNrhnvpXU1YE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wanadoo.fr; spf=pass smtp.mailfrom=wanadoo.fr; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b=GC1Kgc0o; arc=none smtp.client-ip=80.12.242.20 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wanadoo.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wanadoo.fr Received: from fedora.home ([92.140.202.140]) by smtp.orange.fr with ESMTPA id is0Prj31ztrdZis0PrrHzN; Sat, 09 Mar 2024 09:24:36 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1709972676; bh=gVcBB4b2goouePWzmRKHvoTzqcQB5Oy5FKzQOYSOsEo=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=GC1Kgc0o7FHTJ1pc0ke1tYRbBWKh+99jZq+P+pZh2zKK1dhPxt532FcwrjvpEQyPa Je4QNMHO1I16tVsJAFp+Na54kHEaOvmSKa2HkVjY28n0zzrVEwj2bDUL+P1WEeEL0u ymacvNonC7JCi5FsQ7QT0v4Kk8wbnrb0z7koB2vm6SVxVJdG4lE/zW+o+x39m33sJr 9rzs3lz/UKgMv8w2vUvShFGcZPyzhTOsubpgYW4stuoJTsRuKT9MTJ4xCsOEX42nd3 o6G8ROhf80Q8P22xsjOk3M6weWqwmj98UeEbPi+x5B5UcVvqWDJmlGtO+9OhnZPmCW xZoqyKeBODW6Q== X-ME-Helo: fedora.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sat, 09 Mar 2024 09:24:36 +0100 X-ME-IP: 92.140.202.140 From: Christophe JAILLET To: Kees Cook , Tony Luck , "Guilherme G. Piccoli" Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , linux-hardening@vger.kernel.org Subject: [PATCH] pstore/zone: Don't clear memory twice Date: Sat, 9 Mar 2024 09:24:27 +0100 Message-ID: X-Mailer: git-send-email 2.44.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 There is no need to call memset(..., 0, ...) on memory allocated by kcalloc(). It is already zeroed. Remove the redundant call. Signed-off-by: Christophe JAILLET --- fs/pstore/zone.c | 1 - 1 file changed, 1 deletion(-) diff --git a/fs/pstore/zone.c b/fs/pstore/zone.c index abca117725c8..694db616663f 100644 --- a/fs/pstore/zone.c +++ b/fs/pstore/zone.c @@ -1217,7 +1217,6 @@ static struct pstore_zone **psz_init_zones(enum pstore_type_id type, pr_err("allocate for zones %s failed\n", name); return ERR_PTR(-ENOMEM); } - memset(zones, 0, c * sizeof(*zones)); for (i = 0; i < c; i++) { zone = psz_init_zone(type, off, record_size); -- 2.44.0