Commit 692bd2a0 authored by Jia-Ju Bai's avatar Jia-Ju Bai Committed by Alex Deucher

drm/amdgpu/swsmu: fix error return code of smu_v11_0_set_allowed_mask()

When bitmap_empty() or feature->feature_num triggers an error,
no error return code of smu_v11_0_set_allowed_mask() is assigned.
To fix this bug, ret is assigned with -EINVAL as error return code.
Reviewed-by: default avatarEvan Quan <evan.quan@amd.com>
Reported-by: default avatarTOTE Robot <oslab@tsinghua.edu.cn>
Signed-off-by: default avatarJia-Ju Bai <baijiaju1990@gmail.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 554ba183
......@@ -744,8 +744,10 @@ int smu_v11_0_set_allowed_mask(struct smu_context *smu)
int ret = 0;
uint32_t feature_mask[2];
if (bitmap_empty(feature->allowed, SMU_FEATURE_MAX) || feature->feature_num < 64)
if (bitmap_empty(feature->allowed, SMU_FEATURE_MAX) || feature->feature_num < 64) {
ret = -EINVAL;
goto failed;
}
bitmap_copy((unsigned long *)feature_mask, feature->allowed, 64);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment