Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp4793068pxb; Tue, 5 Oct 2021 10:24:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzlAplacg2ewQXDTnY6kEeMbX+Z6gTcF1qrDRW0Txov5oOsx7f2XNspmvuhFA77dxl+WCvc X-Received: by 2002:a17:906:2dc9:: with SMTP id h9mr24816416eji.431.1633454673631; Tue, 05 Oct 2021 10:24:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633454673; cv=none; d=google.com; s=arc-20160816; b=INqHvdxKlal7O6Hj3o0bzWu9syTojJ1UzeCvL66s1X7v7qrdiTTk5ZmdQasFjTNcc+ zS1y+UzGYlpVaoUPqd81I0SY70f+36qQ0S+jWMgS3pUHfUO3QUKprYjPe4gxnjGvDLGz 9HDGTJYUgPsqttnrgY9Hb+EQlcNiJGJB7gfnai2w11N5vCKXkY7Qu6AxPvg1CeUC6epZ ElIKAEpQ/NnAQTpb3VorIwIXaX2zEFjY42bHh9lJJWR6RC6bgExOEUP4N5pbO+AM/GDr M7LwaoyOLCbCZUQm95nA4WLyKBvBRQRHU+bSNpK16b6f+8kK6ec2Y8HXWs5YOA8kFk8n GWOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=0szOl/Q5keJYQjPtxy9YApfb7ftHWXnTXQ4eoRdC7oM=; b=TfodW+dyx7GZJM9Pr9XgARqIOcFZled84Pk+dTGsYg0I8mn3/G9wo3SewKZgVY6OX0 elsGbSexZFMTdN+lNLQttXDviPZev6cLV3kfV4w/lFNnjDAfnAD1VjkavyHElHHvzVeB JBemHIcpCtLG/K3vAWaLZLfeoA69pnwhNeY127AityLr++74g0cT1ZVLhAs6kcBaFtmT 6RAc+gEPOqhGYN8Zgc8+pRAbzCpQC8fV/D6IIMyJumRvq/CSPhL2Kbo0fFsV3YwXANpN SaLcuRUikPnex/nhvg52W+/gL7o+FKObOAM6bst9ljhSXulNnEmZF20+1TBa/VYrXh7b FODg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=EqpIK1vT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f11si2846136eje.97.2021.10.05.10.24.09; Tue, 05 Oct 2021 10:24:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=EqpIK1vT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236746AbhJERWG (ORCPT + 99 others); Tue, 5 Oct 2021 13:22:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236738AbhJERV5 (ORCPT ); Tue, 5 Oct 2021 13:21:57 -0400 Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CA514C061749; Tue, 5 Oct 2021 10:20:06 -0700 (PDT) Received: by mail-pj1-x1035.google.com with SMTP id rm6-20020a17090b3ec600b0019ece2bdd20so150385pjb.1; Tue, 05 Oct 2021 10:20:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=0szOl/Q5keJYQjPtxy9YApfb7ftHWXnTXQ4eoRdC7oM=; b=EqpIK1vTXdHM2T3qpKt7B5M72W9yNHp47Ooa5AzhsBqv/LSEr3GylhgEQKGtBbz8aF ISkGnHZ77zRoof4FGCAdApmHRV4hxmhkzizSs9NOl/xyHgjEVdTwam86QBgOsUuIcb+J MRHmgyoMWSbW56wDErgWeTtD9EB7ErJcD/LDcXR+l+fKPPqx6LUqgKtZ1BGRPPxEfttB kQrD7xtiMRRpIOJPGyXtAAcyb0Dvj+ucWvAf6Q9eOTvEiUobNqdLsz4r2NvwflOVZ198 NleQppPNm4L6lTW5T4nON1Qwp7V7Q6OaU8CaF6s1ggbc5qjIvX2Jv1y2Vhsnc9PenK3Y 6EYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=0szOl/Q5keJYQjPtxy9YApfb7ftHWXnTXQ4eoRdC7oM=; b=jwLhFU1ctaJH/ZZeFIH+XUE2EpzES0z2H9urf/qE9wVXUscPPMAUnSYW6vu660TNDz TIVXilQ6zhIIBFtCArs1AF+xe6jBKQ75S8y/B7+9m2UJNULncEPY/dXLfxRjQUaf6F0R ++NK+9KvkCMMpOEPufOjRNp/ndOOSMZOVvLtZQfk5L9+X8JvaejrYgqH9yGb2X24lc+Q TaEOgvvqKwm5WWqd/2Vdcb9zxS7hQVHNyXBKL6crHtbgt3aMv2GOD9MiL7AkZJUv24in 9KsumNANXHVyL/yGybqHDlU1hJWnqsoFTonLUmtiE2PLDsf4+vy5Wsv/t0cKqjEgH87H rMEA== X-Gm-Message-State: AOAM531SzhfjKACb8XTg6UOOVy7Jg5u6xqgfJad9NzgPenvXNHD6UmfK +9lSeoTfkrPIkqypko/JF8U= X-Received: by 2002:a17:90a:19d2:: with SMTP id 18mr5145011pjj.27.1633454406293; Tue, 05 Oct 2021 10:20:06 -0700 (PDT) Received: from localhost.localdomain ([2406:7400:63:f69:1127:b4ce:ef67:b718]) by smtp.gmail.com with ESMTPSA id f25sm18476722pge.7.2021.10.05.10.20.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Oct 2021 10:20:05 -0700 (PDT) From: Naveen Naidu To: bhelgaas@google.com, ruscur@russell.cc, oohall@gmail.com Cc: Naveen Naidu , linux-kernel-mentees@lists.linuxfoundation.org, skhan@linuxfoundation.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: [PATCH v4 3/8] PCI/DPC: Initialize info->id in dpc_process_error() Date: Tue, 5 Oct 2021 22:48:10 +0530 Message-Id: <5ebe87f18339d7567c1d91203e7c5d31f4e65c52.1633453452.git.naveennaidu479@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In the dpc_process_error() path, info->id isn't initialized before being passed to aer_print_error(). In the corresponding AER path, it is initialized in aer_isr_one_error(). The error message shown during Coverity Scan is: Coverity #1461602 CID 1461602 (#1 of 1): Uninitialized scalar variable (UNINIT) 8. uninit_use_in_call: Using uninitialized value info.id when calling aer_print_error. Initialize the "info->id" before passing it to aer_print_error() Fixes: 8aefa9b0d910 ("PCI/DPC: Print AER status in DPC event handling") Signed-off-by: Naveen Naidu --- drivers/pci/pcie/dpc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/pci/pcie/dpc.c b/drivers/pci/pcie/dpc.c index c556e7beafe3..df3f3a10f8bc 100644 --- a/drivers/pci/pcie/dpc.c +++ b/drivers/pci/pcie/dpc.c @@ -262,14 +262,14 @@ static int dpc_get_aer_uncorrect_severity(struct pci_dev *dev, void dpc_process_error(struct pci_dev *pdev) { - u16 cap = pdev->dpc_cap, status, source, reason, ext_reason; + u16 cap = pdev->dpc_cap, status, reason, ext_reason; struct aer_err_info info; pci_read_config_word(pdev, cap + PCI_EXP_DPC_STATUS, &status); - pci_read_config_word(pdev, cap + PCI_EXP_DPC_SOURCE_ID, &source); + pci_read_config_word(pdev, cap + PCI_EXP_DPC_SOURCE_ID, &info.id); pci_info(pdev, "containment event, status:%#06x source:%#06x\n", - status, source); + status, info.id); reason = (status & PCI_EXP_DPC_STATUS_TRIGGER_RSN) >> 1; ext_reason = (status & PCI_EXP_DPC_STATUS_TRIGGER_RSN_EXT) >> 5; -- 2.25.1