summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2024-08-15 03:01:37 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2024-08-15 03:01:37 +0000
commitc567299c3d89e4c7ab3fe8b1ab2a9583900f374f (patch)
treedfd2997c040a076f72f0fd4f8487bbb24ffd7dbe /sys
parent05b620a19463db081a9a8530209b0cd862d9f888 (diff)
drm/admgpu: fix dereferencing null pointer context
From Jesse Zhang 641dac64178ccdb9e45c92b67120316896294d05 in linux-6.6.y/6.6.46 030ffd4d43b433bc6671d9ec34fc12c59220b95d in mainline linux
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/pci/drm/amd/amdgpu/amdgpu_psp_ta.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/dev/pci/drm/amd/amdgpu/amdgpu_psp_ta.c b/sys/dev/pci/drm/amd/amdgpu/amdgpu_psp_ta.c
index ca5c86e5f7c..8e8afbd237b 100644
--- a/sys/dev/pci/drm/amd/amdgpu/amdgpu_psp_ta.c
+++ b/sys/dev/pci/drm/amd/amdgpu/amdgpu_psp_ta.c
@@ -334,7 +334,7 @@ static ssize_t ta_if_invoke_debugfs_write(struct file *fp, const char *buf, size
set_ta_context_funcs(psp, ta_type, &context);
- if (!context->initialized) {
+ if (!context || !context->initialized) {
dev_err(adev->dev, "TA is not initialized\n");
ret = -EINVAL;
goto err_free_shared_buf;