Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1044089ybb; Fri, 10 Apr 2020 15:58:50 -0700 (PDT) X-Google-Smtp-Source: APiQypKyW6aIw+vafnLgeowsBMCl8KIsGDwSwNRoC/Y/+2CclbLfrQ3BVK+rIUoEW+5HwvIQqSBE X-Received: by 2002:ae9:e210:: with SMTP id c16mr5943236qkc.179.1586559530760; Fri, 10 Apr 2020 15:58:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586559530; cv=none; d=google.com; s=arc-20160816; b=BClJLpWYEYCVunqN1r2Xcd0TNcZAEbfoIjScvUrZBCpR/3MSYgbMZhLi48DeX8/MKy d8Wyqu2aOFDC8nN+JAyCyDHjcUGDP7WwK2sGWQBnFQ58IhouPXHKXOB/dkvoqPvaO0id coUNmYRonEaJzyoieH/QV6G7Es3sE/YkFhQcm0QTjV907RarXO642pUFOdGrgfc6zG17 wFGn3xi1n1TvmjlK6LQr+QMumkxZk1OlvdOFx8z0v0R8ByKE6Y35fFl1+LnktGTVW54A qZBSklbteYr+FdNNJlxMPzUhjgkatl1z9Lk0JFrt/rIUWanSxeWXY2rQrxbR//8qzWNq tl9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=FoaCH0QQlmj4C6N2ENqeu8FEkUk7RiCL9eIdAfJbIS4=; b=hv3/ypCFOnDRhPGmpHNtVHCmtXmAsLrLJDP2hJw74BLMdRxEF6VdLRHbQplEnT/p2d pNdSSX8SwMxViW9wJjldkdTMksILh6pR7u2OhnlMwAkSs6A5VbbptxPTjx7axpNEdGmp zFtUtY9VCjAyFdU5F9aNXNBtHntdTLWYQXEh0IvMNTdniEXvwEQbcQPHp6byODzMNKBd g7I4+IBZOYC++HfZ3kzgEzGfqCv3yNjHR/zgfwj/ltmtxibY0yyuM+m1RmIAiMBiJlUe 4eHPSMNGoNLwMMiMc+ZGvXCZBYGhYLJx1AUF8YjQYkrXMTmWvtA0rLCmzTh5ENW3IYdy yvIw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y19si1693802qvf.125.2020.04.10.15.58.36; Fri, 10 Apr 2020 15:58:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726666AbgDJW6C (ORCPT + 99 others); Fri, 10 Apr 2020 18:58:02 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:52679 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726582AbgDJW6B (ORCPT ); Fri, 10 Apr 2020 18:58:01 -0400 Received: from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1jN2az-00083H-Mj; Fri, 10 Apr 2020 22:57:57 +0000 From: Colin King To: Alex Deucher , =?UTF-8?q?Christian=20K=C3=B6nig?= , David Zhou , David Airlie , Daniel Vetter , John Clements , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] drm/amdgpu: ensure device_list is initialised before calling list_add_tail Date: Fri, 10 Apr 2020 23:57:57 +0100 Message-Id: <20200410225757.97473-1-colin.king@canonical.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Colin Ian King Currently the call to list_add_tail will access an the uninitalised device_list.prev. Fix this by ensuring device_list is initialized before adding items to it. Addresses-Coverity: ("Uninitialized pointer read") Fixes: b3dbd6d3ec49 ("drm/amdgpu: resolve mGPU RAS query instability") Signed-off-by: Colin Ian King --- drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c index b0aa4e1ed4df..caa4969bd46f 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c @@ -1447,6 +1447,7 @@ static void amdgpu_ras_do_recovery(struct work_struct *work) if (hive && adev->gmc.xgmi.num_physical_nodes > 1) { device_list_handle = &hive->device_list; } else { + INIT_LIST_HEAD(&device_list); list_add_tail(&adev->gmc.xgmi.head, &device_list); device_list_handle = &device_list; } -- 2.25.1