* [PATCH] drm/amdgpu: Accessing to a null pointer
@ 2022-04-05 18:24 Grigory Vasilyev
0 siblings, 0 replies; 2+ messages in thread
From: Grigory Vasilyev @ 2022-04-05 18:24 UTC (permalink / raw)
To: Rodrigo Siqueira, Melissa Wen
Cc: Jani Nikula, Jiawei Gu, Grigory Vasilyev, Pan, Xinhui,
Lucas De Marchi, linux-kernel, amd-gfx, David Airlie, dri-devel,
Daniel Vetter, Alex Deucher, Christian König
A typo in the code. It was assumed that it was
possible to shift the pointer to sizeof(BIOS_ATOM_PREFIX) - 1.
Signed-off-by: Grigory Vasilyev <h0tc0d3@gmail.com>
---
drivers/gpu/drm/amd/amdgpu/atom.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/atom.c b/drivers/gpu/drm/amd/amdgpu/atom.c
index e729973af3c9..be9d61bcb8ae 100644
--- a/drivers/gpu/drm/amd/amdgpu/atom.c
+++ b/drivers/gpu/drm/amd/amdgpu/atom.c
@@ -1426,7 +1426,7 @@ static void atom_get_vbios_pn(struct atom_context *ctx)
if (*vbios_str == 0) {
vbios_str = atom_find_str_in_rom(ctx, BIOS_ATOM_PREFIX, 3, 1024, 64);
- if (vbios_str == NULL)
+ if (vbios_str != NULL)
vbios_str += sizeof(BIOS_ATOM_PREFIX) - 1;
}
if (vbios_str != NULL && *vbios_str == 0)
--
2.35.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH] drm/amdgpu: Accessing to a null pointer
@ 2022-04-05 18:30 Grigory Vasilyev
0 siblings, 0 replies; 2+ messages in thread
From: Grigory Vasilyev @ 2022-04-05 18:30 UTC (permalink / raw)
To: Rodrigo Siqueira, Melissa Wen
Cc: Jani Nikula, Jiawei Gu, Grigory Vasilyev, Pan, Xinhui,
Lucas De Marchi, linux-kernel, amd-gfx, David Airlie, dri-devel,
Daniel Vetter, Alex Deucher, Christian König
A typo in the code. It was assumed that it was
possible to shift the pointer to sizeof(BIOS_ATOM_PREFIX) - 1.
Signed-off-by: Grigory Vasilyev <h0tc0d3@gmail.com>
---
drivers/gpu/drm/amd/amdgpu/atom.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/atom.c b/drivers/gpu/drm/amd/amdgpu/atom.c
index e729973af3c9..be9d61bcb8ae 100644
--- a/drivers/gpu/drm/amd/amdgpu/atom.c
+++ b/drivers/gpu/drm/amd/amdgpu/atom.c
@@ -1426,7 +1426,7 @@ static void atom_get_vbios_pn(struct atom_context *ctx)
if (*vbios_str == 0) {
vbios_str = atom_find_str_in_rom(ctx, BIOS_ATOM_PREFIX, 3, 1024, 64);
- if (vbios_str == NULL)
+ if (vbios_str != NULL)
vbios_str += sizeof(BIOS_ATOM_PREFIX) - 1;
}
if (vbios_str != NULL && *vbios_str == 0)
--
2.35.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-04-06 8:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-05 18:24 [PATCH] drm/amdgpu: Accessing to a null pointer Grigory Vasilyev
2022-04-05 18:30 Grigory Vasilyev
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).