mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: "Ma Ke" <make24@iscas.ac.cn>,
	amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	"Alex Deucher" <alexander.deucher@amd.com>,
	"Aurabindo Pillai" <aurabindo.pillai@amd.com>,
	"Chen Jiahao" <chenjiahao16@huawei.com>,
	"Christian König" <christian.koenig@amd.com>,
	"Daniel Vetter" <daniel@ffwll.ch>,
	"David Airlie" <airlied@gmail.com>,
	"Guchun Chen" <guchun.chen@amd.com>,
	"Srinivasan Shanmugam" <srinivasan.shanmugam@amd.com>,
	"Xinhui Pan" <Xinhui.Pan@amd.com>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] drm/amdgpu: fix a possible null pointer dereference
Date: Sat, 22 Jun 2024 16:26:58 +0200	[thread overview]
Message-ID: <0032d02a-b5ae-452e-b26e-14dc7f091e6b@web.de> (raw)
In-Reply-To: <20240622082219.1876200-1-make24@iscas.ac.cn>

> In amdgpu_connector_add_common_modes(), the return value of drm_cvt_mode()
> is assigned to mode, which will lead to a NULL pointer dereference on
> failure of drm_cvt_mode(). Add a check to avoid npd.

Can a wording approach (like the following) be a better change description?

   A null pointer is stored in the local variable “mode” after a call
   of the function “drm_cvt_mode” failed. This pointer was passed to
   a subsequent call of the function “drm_mode_probed_add” where an undesirable
   dereference will be performed then.
   Thus add a corresponding return value check.


Would you like to add any tags (like “Fixes”) accordingly?


How do you think about to use a summary phrase like “Avoid null pointer dereference
in amdgpu_connector_add_common_modes()”?

Regards,
Markus

  reply	other threads:[~2024-06-22 14:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-22  8:22 Ma Ke
2024-06-22 14:26 ` Markus Elfring [this message]
2024-06-23  9:20 ` Joshua Ashton

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=0032d02a-b5ae-452e-b26e-14dc7f091e6b@web.de \
    --to=markus.elfring@web.de \
    --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=chenjiahao16@huawei.com \
    --cc=christian.koenig@amd.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=guchun.chen@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=make24@iscas.ac.cn \
    --cc=srinivasan.shanmugam@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®