From patchwork Tue Sep 26 05:56:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cong Liu X-Patchwork-Id: 144735 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp1698527vqu; Mon, 25 Sep 2023 23:05:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFSXyF/fEGI4YJc06oN75qFreMVRaWB3eRQs1eU4B1YGoCQNbySDcsc3C2BzYx8Xfsz8XHD X-Received: by 2002:a05:6a20:564d:b0:15d:c274:2eb1 with SMTP id is13-20020a056a20564d00b0015dc2742eb1mr6003489pzc.10.1695708304189; Mon, 25 Sep 2023 23:05:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695708304; cv=none; d=google.com; s=arc-20160816; b=vCc69HXLEyrunSLvJ/rHiT/e6nJREFnM+RDGpOIvumOl1Tz9MzHSrl7zRQLaiXh+OV y/pzNpcIzkGz2UWASQvjtWr14afsXSfK3fSzA315HpBJPso0RvdUF41a+D8FdHniDOGA rtMW+cTj2V02Rv9ivZ2Hk7XMsUO1o8/5SvSvqXDN1ZiKL2zt2W5fh7L6xRHhARIZtaQq 4p9oBsBcT8KVpWduV5FH8oJPjN9OkEuXEF6NMKtr1dkwoZ1XHZ+alQzXaGQqunibYHPD k+9RYxHwm8uIhKvsABnsM3IjICvRlcno9UodsoWKrAgpo63wjZpZK4n+BJjs5u7dHHPp LS2A== 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 :message-id:date:subject:cc:to:from; bh=xaLN3bUjJ2TfmzLNkr2YFYQFc55g8TAzz3ecOcckGQ4=; fh=Y4KPzTfXNHevA2GvFfn4pFCqxHZQYb62OXCfgRBC4fI=; b=GHp4r6hFwAr+Yb9kNfeKbX1cJ9lpNoWfzCfICjxNvdHFEO8pcwD3N9FNiauTBkBtpY udFea/SRoyOrPS3b2/oxWc3gVYv5MFuD0hK+sRGEhjuKYcTL/C3H+9e3TU2XF24eoEft Hst20Q2VUu2NvFGTcwNJ7UTyd7usG/0Jw2ApQG6x01PMo051sLXPzfN84ZFXveRkhPUl ku5c9K/JZ9qmWWjqfQpI9gdROR4cGB7y0TP6qIB73xNq5Og//7TpbD9m38Z1QcXKCf40 +2K3K/+og17AOSmEtu2cdlEqnBh6NELMKHJaUyJb/LRBRoY110ul5tf+LskUIjzLfXY/ 6qAw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id cn12-20020a056a020a8c00b00564a5b8937asi11295455pgb.341.2023.09.25.23.05.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 23:05:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id E015280A1E31; Mon, 25 Sep 2023 22:56:53 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233680AbjIZF4u (ORCPT + 26 others); Tue, 26 Sep 2023 01:56:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44142 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233689AbjIZF4r (ORCPT ); Tue, 26 Sep 2023 01:56:47 -0400 Received: from mailgw.kylinos.cn (mailgw.kylinos.cn [124.126.103.232]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3FE1810A for ; Mon, 25 Sep 2023 22:56:40 -0700 (PDT) X-UUID: 48b130231b3f480fa2b389aa17cc4c13-20230926 X-CID-O-RULE: Release_Ham X-CID-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.31,REQID:274d52f7-406d-450b-9626-9226bea3d323,IP:5,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:-15,FILE:0,BULK:0,RULE:Release_Ham,ACTIO N:release,TS:-10 X-CID-INFO: VERSION:1.1.31,REQID:274d52f7-406d-450b-9626-9226bea3d323,IP:5,URL :0,TC:0,Content:0,EDM:0,RT:0,SF:-15,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:-10 X-CID-META: VersionHash:0ad78a4,CLOUDID:710a47bf-14cc-44ca-b657-2d2783296e72,B ulkID:23092613562995M22TSX,BulkQuantity:0,Recheck:0,SF:19|44|38|24|17|102, TC:nil,Content:0,EDM:-3,IP:-2,URL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0 ,OSI:0,OSA:0,AV:0,LES:1,SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0 X-CID-BVR: 0 X-CID-BAS: 0,_,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR,TF_CID_SPAM_FAS,TF_CID_SPAM_FSD,TF_CID_SPAM_FSI X-UUID: 48b130231b3f480fa2b389aa17cc4c13-20230926 X-User: liucong2@kylinos.cn Received: from localhost.localdomain [(116.128.244.169)] by mailgw (envelope-from ) (Generic MTA) with ESMTP id 827163063; Tue, 26 Sep 2023 13:56:29 +0800 From: Cong Liu To: Harry Wentland , Leo Li , Rodrigo Siqueira , Alex Deucher , =?utf-8?q?Christian_K=C3=B6nig?= , "Pan, Xinhui" , David Airlie , Daniel Vetter , Aurabindo Pillai , Tom Chung Cc: Cong Liu , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] drm/amd/display: Fix null pointer dereference in error message Date: Tue, 26 Sep 2023 13:56:17 +0800 Message-Id: <20230926055618.119195-1-liucong2@kylinos.cn> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Mon, 25 Sep 2023 22:56:53 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778079030688115886 X-GMAIL-MSGID: 1778079030688115886 This patch fixes a null pointer dereference in the error message that is printed when the Display Core (DC) fails to initialize. The original message includes the DC version number, which is undefined if the DC is not initialized. Fixes: 9788d087caff ("drm/amd/display: improve the message printed when loading DC") Signed-off-by: Cong Liu Reviewed-by: Harry Wentland --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index 8e98dda1e084..bf52a909f558 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -1703,8 +1703,7 @@ static int amdgpu_dm_init(struct amdgpu_device *adev) DRM_INFO("Display Core v%s initialized on %s\n", DC_VER, dce_version_to_string(adev->dm.dc->ctx->dce_version)); } else { - DRM_INFO("Display Core v%s failed to initialize on %s\n", DC_VER, - dce_version_to_string(adev->dm.dc->ctx->dce_version)); + DRM_INFO("Display Core failed to initialize with v%s!\n", DC_VER); goto error; }