mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Harry Wentland <harry.wentland@amd.com>
To: "Christian König" <christian.koenig@amd.com>,
	"Cong Liu" <liucong2@kylinos.cn>, "Leo Li" <sunpeng.li@amd.com>,
	"Rodrigo Siqueira" <Rodrigo.Siqueira@amd.com>,
	"Alex Deucher" <alexander.deucher@amd.com>,
	"Pan, Xinhui" <Xinhui.Pan@amd.com>,
	"David Airlie" <airlied@gmail.com>,
	"Daniel Vetter" <daniel@ffwll.ch>,
	"Aurabindo Pillai" <aurabindo.pillai@amd.com>,
	"Tom Chung" <chiahsuan.chung@amd.com>
Cc: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] drm/amd/display: Fix null pointer dereference in error message
Date: Wed, 27 Sep 2023 10:07:26 -0400	[thread overview]
Message-ID: <7375c718-86fb-4c71-a4b4-b96909181fa5@amd.com> (raw)
In-Reply-To: <82ff7880-f323-b208-b52b-90bd568af934@amd.com>



On 2023-09-27 01:23, Christian König wrote:
> Am 26.09.23 um 15:09 schrieb Harry Wentland:
>>
>> On 2023-09-26 01:56, Cong Liu wrote:
>>> 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 <liucong2@kylinos.cn>
>>> ---
>>>   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);
>> There is value in printing the version number. Let's not remove it.
>>
>> Instead you can probably fix it by doing a NULL check on adev->dm.dc->ctx.
> 
> But as far as I understand it adev->dm.dc->ctx will always be NULL in this case.
> 

Thanks, Christian. We're in the else of the NULL check for
adev-dm.dc, so obviously we can't get the version. Silly me.

Your patch is
Reviewed-by: Harry Wentland <harry.wentland@amd.com>

Harry

> Regards,
> Christian.
> 
>>
>> Harry
>>
>>>           goto error;
>>>       }
>>>   
> 


  reply	other threads:[~2023-09-27 14:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-26  5:56 Cong Liu
2023-09-26 13:09 ` Harry Wentland
2023-09-27  2:15   ` Cong Liu
2023-09-27  5:23   ` Christian König
2023-09-27 14:07     ` Harry Wentland [this message]
2023-09-27 17:44       ` Harry Wentland

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7375c718-86fb-4c71-a4b4-b96909181fa5@amd.com \
    --to=harry.wentland@amd.com \
    --cc=Rodrigo.Siqueira@amd.com \
    --cc=Xinhui.Pan@amd.com \
    --cc=airlied@gmail.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=aurabindo.pillai@amd.com \
    --cc=chiahsuan.chung@amd.com \
    --cc=christian.koenig@amd.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liucong2@kylinos.cn \
    --cc=sunpeng.li@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®