From: Grigory Vasilyev <h0tc0d3@gmail.com>
To: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>,
Melissa Wen <mwen@igalia.com>
Cc: "Grigory Vasilyev" <h0tc0d3@gmail.com>,
"Alex Deucher" <alexander.deucher@amd.com>,
"Christian König" <christian.koenig@amd.com>,
"Pan, Xinhui" <Xinhui.Pan@amd.com>,
"David Airlie" <airlied@linux.ie>,
"Daniel Vetter" <daniel@ffwll.ch>,
"Michel Dänzer" <mdaenzer@redhat.com>,
"Simon Ser" <contact@emersion.fr>,
"Evan Quan" <evan.quan@amd.com>,
"Bas Nieuwenhuizen" <bas@basnieuwenhuizen.nl>,
"Sean Paul" <seanpaul@chromium.org>,
"Qingqing Zhuo" <qingqing.zhuo@amd.com>,
amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org
Subject: [PATCH] drm/amdgpu: Fix NULL pointer dereference
Date: Fri, 8 Apr 2022 12:28:02 +0300 [thread overview]
Message-ID: <20220408092803.3188-1-h0tc0d3@gmail.com> (raw)
The code below check for NULL, but is no check at this place, which is
potentially dangerous.
Signed-off-by: Grigory Vasilyev <h0tc0d3@gmail.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
index d26810e7311d..c773a92dd4e5 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
@@ -1017,8 +1017,10 @@ static int amdgpu_display_get_fb_info(const struct amdgpu_framebuffer *amdgpu_fb
int r;
if (!amdgpu_fb) {
- *tiling_flags = 0;
- *tmz_surface = false;
+ if (tiling_flags)
+ *tiling_flags = 0;
+ if (tmz_surface)
+ *tmz_surface = false;
return 0;
}
--
2.35.1
next reply other threads:[~2022-04-08 9:28 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-08 9:28 Grigory Vasilyev [this message]
2022-04-08 10:01 ` Simon Ser
2022-04-08 11:28 ` Bas Nieuwenhuizen
2022-04-08 11:48 ` Simon Ser
2022-04-08 13:21 ` Grigory Vasilyev
2022-04-08 13:26 ` Simon Ser
2022-04-08 14:30 ` Christian König
2022-04-10 0:51 ` Grigory Vasilyev
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=20220408092803.3188-1-h0tc0d3@gmail.com \
--to=h0tc0d3@gmail.com \
--cc=Rodrigo.Siqueira@amd.com \
--cc=Xinhui.Pan@amd.com \
--cc=airlied@linux.ie \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=bas@basnieuwenhuizen.nl \
--cc=christian.koenig@amd.com \
--cc=contact@emersion.fr \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=evan.quan@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mdaenzer@redhat.com \
--cc=mwen@igalia.com \
--cc=qingqing.zhuo@amd.com \
--cc=seanpaul@chromium.org \
/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®