From: Heng Qi <hengqi@linux.alibaba.com>
To: Chen Ni <nichen@iscas.ac.cn>
Cc: virtualization@lists.linux.dev,
spice-devel@lists.freedesktop.org,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
airlied@redhat.com, kraxel@redhat.com,
maarten.lankhorst@linux.intel.com, mripard@kernel.org,
tzimmermann@suse.de, airlied@gmail.com, daniel@ffwll.ch,
noralf@tronnes.org
Subject: Re: [PATCH] drm/qxl: Add check for drm_cvt_mode
Date: Fri, 21 Jun 2024 16:48:13 +0800 [thread overview]
Message-ID: <78a99414-314d-452e-938b-07e86182a8bf@linux.alibaba.com> (raw)
In-Reply-To: <20240621071031.1987974-1-nichen@iscas.ac.cn>
在 2024/6/21 下午3:10, Chen Ni 写道:
> Add check for the return value of drm_cvt_mode() and return the error if
> it fails in order to avoid NULL pointer dereference.
>
> Fixes: 1b043677d4be ("drm/qxl: add qxl_add_mode helper function")
> Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
> ---
> drivers/gpu/drm/qxl/qxl_display.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl/qxl_display.c
> index c6d35c33d5d6..86a5dea710c0 100644
> --- a/drivers/gpu/drm/qxl/qxl_display.c
> +++ b/drivers/gpu/drm/qxl/qxl_display.c
> @@ -236,6 +236,9 @@ static int qxl_add_mode(struct drm_connector *connector,
> return 0;
>
> mode = drm_cvt_mode(dev, width, height, 60, false, false, false);
> + if (!mode)
> + return 0;
> +
> if (preferred)
> mode->type |= DRM_MODE_TYPE_PREFERRED;
> mode->hdisplay = width;
Reviewed-by: Heng Qi <hengqi@linux.alibaba.com>
Thanks.
next prev parent reply other threads:[~2024-06-21 8:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-21 7:10 Chen Ni
2024-06-21 8:48 ` Heng Qi [this message]
2024-06-26 13:35 ` (subset) " Maxime Ripard
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=78a99414-314d-452e-938b-07e86182a8bf@linux.alibaba.com \
--to=hengqi@linux.alibaba.com \
--cc=airlied@gmail.com \
--cc=airlied@redhat.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=kraxel@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=nichen@iscas.ac.cn \
--cc=noralf@tronnes.org \
--cc=spice-devel@lists.freedesktop.org \
--cc=tzimmermann@suse.de \
--cc=virtualization@lists.linux.dev \
/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®