mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
drm/amdgpu: fix NULL pointer in amdgpu_reset_get_desc
amdgpu_job_ring may return NULL, which causes kernel NULL pointer error, using another way to print ring name instead of ring->name. Suggested-by: Lijo Lazar <Lijo.Lazar@amd.com> Signed-off-by: Eric Huang <jinhuieric.huang@amd.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Lijo Lazar <lijo.lazar@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
6218bd6b22
commit
7bed1df814
1 changed files with 2 additions and 4 deletions
|
@ -164,16 +164,14 @@ void amdgpu_device_unlock_reset_domain(struct amdgpu_reset_domain *reset_domain)
|
|||
void amdgpu_reset_get_desc(struct amdgpu_reset_context *rst_ctxt, char *buf,
|
||||
size_t len)
|
||||
{
|
||||
struct amdgpu_ring *ring;
|
||||
|
||||
if (!buf || !len)
|
||||
return;
|
||||
|
||||
switch (rst_ctxt->src) {
|
||||
case AMDGPU_RESET_SRC_JOB:
|
||||
if (rst_ctxt->job) {
|
||||
ring = amdgpu_job_ring(rst_ctxt->job);
|
||||
snprintf(buf, len, "job hang on ring:%s", ring->name);
|
||||
snprintf(buf, len, "job hang on ring:%s",
|
||||
rst_ctxt->job->base.sched->name);
|
||||
} else {
|
||||
strscpy(buf, "job hang", len);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue