diff options
| author | Dan Carpenter <[email protected]> | 2021-04-14 05:58:55 +0000 |
|---|---|---|
| committer | Alex Deucher <[email protected]> | 2021-04-15 20:32:45 +0000 |
| commit | 90cb3d8aca1baea9471d28f28d5de1528dd5e424 (patch) | |
| tree | 04a530542a583028f273579873d6c712a50e9c93 | |
| parent | drm/radeon/cik: remove set but not used variables (diff) | |
| download | kernel-90cb3d8aca1baea9471d28f28d5de1528dd5e424.tar.gz kernel-90cb3d8aca1baea9471d28f28d5de1528dd5e424.zip | |
drm/amdgpu: fix an error code in init_pmu_entry_by_type_and_add()
If the kmemdup() fails then this should return a negative error code
but it currently returns success
Fixes: b4a7db71ea06 ("drm/amdgpu: add per device user friendly xgmi events for vega20")
Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_pmu.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pmu.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_pmu.c index 19c0a3655228..82e9ecf84352 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pmu.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_pmu.c @@ -519,8 +519,10 @@ static int init_pmu_entry_by_type_and_add(struct amdgpu_pmu_entry *pmu_entry, pmu_entry->pmu.attr_groups = kmemdup(attr_groups, sizeof(attr_groups), GFP_KERNEL); - if (!pmu_entry->pmu.attr_groups) + if (!pmu_entry->pmu.attr_groups) { + ret = -ENOMEM; goto err_attr_group; + } snprintf(pmu_name, PMU_NAME_SIZE, "%s_%d", pmu_entry->pmu_file_prefix, adev_to_drm(pmu_entry->adev)->primary->index); |
