Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp3653774pxb; Mon, 4 Oct 2021 06:58:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzcCgbauZOib1PCSvHFNPrPs93KtkFWTC1XZAkbnuMcWoCT+UgIJok/d20vFccpA8rA48f2 X-Received: by 2002:a05:6402:447:: with SMTP id p7mr385571edw.261.1633355928703; Mon, 04 Oct 2021 06:58:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633355928; cv=none; d=google.com; s=arc-20160816; b=bE4z2uLVWxhckNxu0RSYepIqv+FT+7wrSfkXb3JaYeq8K/N+io1zskfgHdnLrgD8H2 6GSWqjp3ZOfP6T3sCrkMuVC4FRtPReVQPcpJrLaqV9mDvu2+G2Bw0mpc8iVLesNXSh1x cXsT1oozOit6SRSORXgpb3hhcJAakD6+HmLuPQaUcbt68pkYMnPaJV6H6i2KbCEEKfKF zYQCnhV9zYGe4ndzvwBN+Ut+OzbS+ENP95gi4KVAoMzhQeevieMVg5f8IuOITE6FKGX4 wM3jZ/iGKr/SaVa7sCnc3I1h2CsrRMsg3y0nVStR5tFVRodNRr8vIJcv0heTyWp3Egot NdaA== 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=HiOI5Ih5hsP0F1SgJ3B+8U/mC3nCpVPq/tc9w6rR6mBNVDJWLTa6ziv4nr/suNy6sO dzmVnsEL1VNS9mlUy2QdvvXQwpvpvOIICWpeczNH25mzit3R1sn1Sny1qL6V2ef9iu9i o/E2+EMKiWFO8cJYDXoHkKEkPviHwu26UaaO+pQi7hL/bK9ZJj1gI46B8nQStxzHEk8L 6VJvVuIlMGYWj5gfIvFoVY83AaZgVimcG3nj7U1AUCcLnwApS5dB5WchwIx+J8mj0HMe X251qwxlRC81QOTbQY0pgYuXcZtmSLL2eviIzp+zJweREJN/3Az8F3cVXpcv4RQVm0GY Zytg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=PpuJlKKn; 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 i15si8640137edr.292.2021.10.04.06.58.24; Mon, 04 Oct 2021 06:58:48 -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=PpuJlKKn; 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 S233300AbhJDN6Z (ORCPT + 99 others); Mon, 4 Oct 2021 09:58:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40318 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238857AbhJDN6T (ORCPT ); Mon, 4 Oct 2021 09:58:19 -0400 Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com [IPv6:2607:f8b0:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A3C3C04AEDD for ; Mon, 4 Oct 2021 06:53:39 -0700 (PDT) Received: by mail-pf1-x429.google.com with SMTP id 187so10150688pfc.10 for ; Mon, 04 Oct 2021 06:53:39 -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=PpuJlKKnU2ogwrrbB82jmOo0YlJoX1B8j5N8kx/iU153EJ1sn+ERmcL4bT8Ty3x4fH ZPekROvXKmmkST4W+zyV5s1ETxRFaksYBZmGTWeZrWqAfuJOgPX8Vp+Kaj09grA2v49s mevWdSPrZAarCQ2oPLB+ulnkxOtCdohDxTS2e5f58wdWhRnS0jt/nPpXfDPLU+yMRvHX 0KJb1EOQY0JK4Iu5vcO228swY3eTAgLvQUkf/ITZp8jDYznVRR6Y/GyOp11gfDGiw0HQ MrWi8/pHprykWPqO7R6N1m5nR7wPRtwOgMIL05mtTNtU4KjwghTClk31N/9I5dFxe/7g Jj3w== 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=wV6aGl8ypEDZj3r1Y1IB2z1FVwkOddaKmpdv395E8QwexZQNHZerDz3wUoxQ5u9krE Yc+EIOPBtFY5jL9/VrsrZ52R75V4+s0VEuhcU1160icO4dIhwJDhBIdYZZRYb1lmad0R O7ZigVPmfjdlHPDdvn15IpeGdpnXRSrqf1wmBf/nQ336ZR1qUTa77R9C3bbm1sLsjG9E FNTpSvKEbaNGTjvoGUv8Ba/M5B3BcpysuJRjqY9+pJqe9x+bm+RDKqfCOJIKemfJNwJa pZzozfjhUmzp31kTMMk9tDBCUm689KtrColUdmhxBpO9bhbZtaqNe3qwbXE8TELCL9pD KJRg== X-Gm-Message-State: AOAM533Im9H3w7NOH4sDDtRFwtjd2t+1bbSlJcUn0pgMLzdZwfxuzD7w 93EY+3KiQHRTtz8YBYouWj0= X-Received: by 2002:aa7:870b:0:b0:44b:bcef:32b4 with SMTP id b11-20020aa7870b000000b0044bbcef32b4mr25767456pfo.41.1633355618807; Mon, 04 Oct 2021 06:53:38 -0700 (PDT) Received: from localhost.localdomain ([2406:7400:63:e8f0:c2a7:3579:5fe8:31d9]) by smtp.gmail.com with ESMTPSA id k17sm12209548pfu.82.2021.10.04.06.53.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Oct 2021 06:53:38 -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 Subject: [PATCH 3/8] PCI/DPC: Initialize info->id in dpc_process_error() Date: Mon, 4 Oct 2021 19:22:38 +0530 Message-Id: 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