From: jsg Date: Thu, 15 Aug 2024 03:01:36 +0000 (+0000) Subject: drm/admgpu: fix dereferencing null pointer context X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=926193d6dbf0f48a47ba9f32f797ff19d5368c47;p=openbsd drm/admgpu: fix dereferencing null pointer context From Jesse Zhang 641dac64178ccdb9e45c92b67120316896294d05 in linux-6.6.y/6.6.46 030ffd4d43b433bc6671d9ec34fc12c59220b95d in mainline linux --- 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;