From: Markus Elfring <Markus.Elfring@web.de>
To: Ma Ke <make24@iscas.ac.cn>,
dri-devel@lists.freedesktop.org, Daniel Vetter <daniel@ffwll.ch>,
David Airlie <airlied@gmail.com>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
Patrik Jakobsson <patrik.r.jakobsson@gmail.com>,
Thomas Zimmermann <tzimmermann@suse.de>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] drm/gma500: fix null pointer dereference in psb_intel_lvds_get_modes
Date: Wed, 26 Jun 2024 12:18:08 +0200 [thread overview]
Message-ID: <84c7c61a-9de2-47d7-8420-87a2b389e684@web.de> (raw)
In-Reply-To: <20240626011656.2763368-1-make24@iscas.ac.cn>
> In psb_intel_lvds_get_modes(), the return value of drm_mode_duplicate() is
> assigned to mode, which will lead to a possible NULL pointer dereference
> on failure of drm_mode_duplicate(). Add a check to avoid npd.
1. 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_mode_duplicate” 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.
2. Would you like to add any tags (like “Fixes” and “Cc”) accordingly?
3. How do you think about to append parentheses to the function name
in the summary phrase?
4. How do you think about to put similar results from static source code
analyses into corresponding patch series?
Regards,
Markus
prev parent reply other threads:[~2024-06-26 10:18 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-26 1:16 [PATCH] drm/gma500: fix null pointer dereference in psb_intel_lvds_get_modes Ma Ke
2024-06-26 9:44 ` Jani Nikula
2024-06-26 10:18 ` Markus Elfring [this message]
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=84c7c61a-9de2-47d7-8420-87a2b389e684@web.de \
--to=markus.elfring@web.de \
--cc=airlied@gmail.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=make24@iscas.ac.cn \
--cc=mripard@kernel.org \
--cc=patrik.r.jakobsson@gmail.com \
--cc=tzimmermann@suse.de \
/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