From 926193d6dbf0f48a47ba9f32f797ff19d5368c47 Mon Sep 17 00:00:00 2001 From: jsg Date: Thu, 15 Aug 2024 03:01:36 +0000 Subject: [PATCH] drm/admgpu: fix dereferencing null pointer context From Jesse Zhang 641dac64178ccdb9e45c92b67120316896294d05 in linux-6.6.y/6.6.46 030ffd4d43b433bc6671d9ec34fc12c59220b95d in mainline linux --- sys/dev/pci/drm/amd/amdgpu/amdgpu_psp_ta.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.20.1