From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D52F3C388F9 for ; Tue, 27 Oct 2020 18:25:44 +0000 (UTC) Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 335702068E for ; Tue, 27 Oct 2020 18:25:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=alien8.de header.i=@alien8.de header.b="EgbFsJdf" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 335702068E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=alien8.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=virtualization-bounces@lists.linux-foundation.org Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 994E820490; Tue, 27 Oct 2020 18:25:43 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9WtOvexDqIwW; Tue, 27 Oct 2020 18:25:40 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by silver.osuosl.org (Postfix) with ESMTP id 925DB20520; Tue, 27 Oct 2020 18:25:40 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 74E64C0859; Tue, 27 Oct 2020 18:25:40 +0000 (UTC) Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists.linuxfoundation.org (Postfix) with ESMTP id A9463C0051 for ; Tue, 27 Oct 2020 18:25:38 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 930EE8734E for ; Tue, 27 Oct 2020 18:25:38 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2evjHy3YhExx for ; Tue, 27 Oct 2020 18:25:37 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail.skyhub.de (mail.skyhub.de [5.9.137.197]) by hemlock.osuosl.org (Postfix) with ESMTPS id 08AF08734C for ; Tue, 27 Oct 2020 18:25:35 +0000 (UTC) Received: from zn.tnic (p200300ec2f0dae00bf53706700052072.dip0.t-ipconnect.de [IPv6:2003:ec:2f0d:ae00:bf53:7067:5:2072]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id BAB771EC0212; Tue, 27 Oct 2020 19:25:32 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1603823132; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=HIlEQ668ZK65lA6MbCzNrMzTRfwiOqR1WIXbuHA3yjs=; b=EgbFsJdf1OZ3IGcke8XXZo3hz2cAmj/RcULw8QVmtef7YinSrbWCYFvbL5yywQPkzemwXO N724w3YmM6BIy+GiS4LbNct6nLnnKYjmBEbvDSj3xaVvbYC4cp66jlosXNW/p8ekCy1vAQ YuPzn8Qmf75kT/ZiIBq27HMK3PaA71Y= Date: Tue, 27 Oct 2020 19:25:20 +0100 From: Borislav Petkov To: Bartosz Golaszewski Subject: Re: [PATCH 5/8] edac: ghes: use krealloc_array() Message-ID: <20201027182520.GK15580@zn.tnic> References: <20201027121725.24660-1-brgl@bgdev.pl> <20201027121725.24660-6-brgl@bgdev.pl> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20201027121725.24660-6-brgl@bgdev.pl> Cc: alsa-devel@alsa-project.org, kvm@vger.kernel.org, "Michael S . Tsirkin" , David Airlie , Gustavo Padovan , Linus Walleij , dri-devel@lists.freedesktop.org, Jaroslav Kysela , linux-mm@kvack.org, Christoph Lameter , Sumit Semwal , Mauro Carvalho Chehab , Bartosz Golaszewski , Alexander Shishkin , David Rientjes , virtualization@lists.linux-foundation.org, linux-media@vger.kernel.org, Robert Richter , Thomas Zimmermann , Maarten Lankhorst , Maxime Ripard , linaro-mm-sig@lists.linaro.org, linux-gpio@vger.kernel.org, Andy Shevchenko , Joonsoo Kim , linux-edac@vger.kernel.org, Tony Luck , netdev@vger.kernel.org, Takashi Iwai , linux-kernel@vger.kernel.org, Pekka Enberg , James Morse , Daniel Vetter , Andrew Morton , Christian =?utf-8?B?S8O2bmln?= X-BeenThere: virtualization@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Linux virtualization List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: virtualization-bounces@lists.linux-foundation.org Sender: "Virtualization" On Tue, Oct 27, 2020 at 01:17:22PM +0100, Bartosz Golaszewski wrote: > From: Bartosz Golaszewski > > Use the helper that checks for overflows internally instead of manually > calculating the size of the new array. > > Signed-off-by: Bartosz Golaszewski > --- > drivers/edac/ghes_edac.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/edac/ghes_edac.c b/drivers/edac/ghes_edac.c > index a918ca93e4f7..6d1ddecbf0da 100644 > --- a/drivers/edac/ghes_edac.c > +++ b/drivers/edac/ghes_edac.c > @@ -207,8 +207,8 @@ static void enumerate_dimms(const struct dmi_header *dh, void *arg) > if (!hw->num_dimms || !(hw->num_dimms % 16)) { > struct dimm_info *new; > > - new = krealloc(hw->dimms, (hw->num_dimms + 16) * sizeof(struct dimm_info), > - GFP_KERNEL); > + new = krealloc_array(hw->dimms, hw->num_dimms + 16, > + sizeof(struct dimm_info), GFP_KERNEL); > if (!new) { > WARN_ON_ONCE(1); > return; > -- Sure, why not. Acked-by: Borislav Petkov -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette _______________________________________________ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization