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 Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E4F1DC54E65 for ; Wed, 21 May 2025 08:52:29 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [127.0.0.1]) by lists.ozlabs.org (Postfix) with ESMTP id 4b2QCw38yBz3bkf; Wed, 21 May 2025 18:52:28 +1000 (AEST) Authentication-Results: lists.ozlabs.org; arc=none smtp.remote-ip=185.176.79.56 ARC-Seal: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1747817548; cv=none; b=Fc7cXhy9P6bJTxbTLBy0467NxfHpKp3K3+gWmRXmMCXohoOwxw0J/QRctN4STprfh0fWQCOkyKGu2ms8pwFs7UtCc6IiXQ0fVeJxw//FYvlaDPMxMVRn/fvoQTdHXFAfmCNovBhMbpBU/29/Df1w+yUPABamEfu4w8TAxM/mUD8BgXXHqhn6ZtsQT8i8wFfycFjhWPkpQdCpykXCXiIfGFpca+6GDfOrpN2K52c1vtnsNWoG++q651BJVulQ/dlQLTApSZk8DtvT6Cd4jcOd6C/UI36mMGyy7eiFDyQwXoN4Qm0CHoaskI7Q9SSvs/jocYprIUKIVv4iCrsgCeknmw== ARC-Message-Signature: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1747817548; c=relaxed/relaxed; bh=tlam0s0W3NDQh1bBnP7Bz7mO7SVJY7j0wuTia8ideCs=; h=Date:From:To:CC:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=WvUDAAS3dVx0LT0ZJhSPYxazFzGPjvdpYyPbgX81qbuhz2B70iRPFMeOH0Cx+2tyerYFJufF2/0J19tujCEDFoFqXIAep80XemeM0abqfOv76l47mY4A+bnG1tU26c5LzNf/NMF4wix8vymYVh00d/3jGlN/bI5gv5X89uB4R2CFtHa9Gj0HlDCaJt2C0rkvI+DqpYtI7a0WNoJAj9oItrJlM4zo8rJ7T4QrYAgxXL+jC4PnFJJnRJ2iGmaXDoA42onvQ5TAUutxWWet3ei+JJsB/iB0drtbElYLgBKlYDLTu4sR15yk3gJQ+9Lb/mOt/GLO14fGk3xzPayQxX1vKw== ARC-Authentication-Results: i=1; lists.ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass (client-ip=185.176.79.56; helo=frasgout.his.huawei.com; envelope-from=jonathan.cameron@huawei.com; receiver=lists.ozlabs.org) smtp.mailfrom=huawei.com Authentication-Results: lists.ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=huawei.com (client-ip=185.176.79.56; helo=frasgout.his.huawei.com; envelope-from=jonathan.cameron@huawei.com; receiver=lists.ozlabs.org) Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4b2QCv3536z2ydl for ; Wed, 21 May 2025 18:52:25 +1000 (AEST) Received: from mail.maildlp.com (unknown [172.18.186.216]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4b2Q860q9kz6H7mn; Wed, 21 May 2025 16:49:10 +0800 (CST) Received: from frapeml500008.china.huawei.com (unknown [7.182.85.71]) by mail.maildlp.com (Postfix) with ESMTPS id E8D9C14020A; Wed, 21 May 2025 16:52:20 +0800 (CST) Received: from localhost (10.203.177.66) by frapeml500008.china.huawei.com (7.182.85.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Wed, 21 May 2025 10:52:19 +0200 Date: Wed, 21 May 2025 09:52:18 +0100 From: Jonathan Cameron To: Bjorn Helgaas CC: , Jon Pan-Doh , "Karolina Stolarek" , Weinan Liu , Martin Petersen , Ben Fuller , Drew Walton , "Anil Agrawal" , Tony Luck , Ilpo =?UTF-8?Q?J=C3=A4rvinen?= , "Sathyanarayanan Kuppuswamy" , Lukas Wunner , Sargun Dhillon , "Paul E . McKenney" , Mahesh J Salgaonkar , "Oliver O'Halloran" , Kai-Heng Feng , "Keith Busch" , Robert Richter , Terry Bowman , Shiju Jose , Dave Jiang , , , Bjorn Helgaas , Krzysztof =?UTF-8?Q?Wilczy=C5=84ski?= Subject: Re: [PATCH v7 01/17] PCI/DPC: Initialize aer_err_info before using it Message-ID: <20250521095218.0000045d@huawei.com> In-Reply-To: <20250520215047.1350603-2-helgaas@kernel.org> References: <20250520215047.1350603-1-helgaas@kernel.org> <20250520215047.1350603-2-helgaas@kernel.org> X-Mailer: Claws Mail 4.3.0 (GTK 3.24.42; x86_64-w64-mingw32) X-Mailing-List: linuxppc-dev@lists.ozlabs.org List-Id: List-Help: List-Owner: List-Post: List-Archive: , List-Subscribe: , , List-Unsubscribe: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.203.177.66] X-ClientProxiedBy: lhrpeml100006.china.huawei.com (7.191.160.224) To frapeml500008.china.huawei.com (7.182.85.71) On Tue, 20 May 2025 16:50:18 -0500 Bjorn Helgaas wrote: > From: Bjorn Helgaas >=20 > Previously the struct aer_err_info "info" was allocated on the stack > without being initialized, so it contained junk except for the fields we > explicitly set later. >=20 > Initialize "info" at declaration so it starts as all zeros. >=20 > Signed-off-by: Bjorn Helgaas > Tested-by: Krzysztof Wilczy=C5=84ski > Reviewed-by: Kuppuswamy Sathyanarayanan I chased this through a bit and looks like at least some unset fields would result in garbage prints. So maybe needs a fixes tag? info->tlp_header_valid is an easy one to follow as only set in some paths. Otherwise absolutely makes sense. Reviewed-by: Jonathan Cameron > --- > drivers/pci/pcie/dpc.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/drivers/pci/pcie/dpc.c b/drivers/pci/pcie/dpc.c > index df42f15c9829..3daaf61c79c9 100644 > --- a/drivers/pci/pcie/dpc.c > +++ b/drivers/pci/pcie/dpc.c > @@ -258,7 +258,7 @@ static int dpc_get_aer_uncorrect_severity(struct pci_= dev *dev, > void dpc_process_error(struct pci_dev *pdev) > { > u16 cap =3D pdev->dpc_cap, status, source, reason, ext_reason; > - struct aer_err_info info; > + struct aer_err_info info =3D {}; > =20 > pci_read_config_word(pdev, cap + PCI_EXP_DPC_STATUS, &status); > pci_read_config_word(pdev, cap + PCI_EXP_DPC_SOURCE_ID, &source);