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: Evan Quan <evan.quan@amd.com> Reported-by: TOTE Robot <oslab@tsinghua.edu.cn> Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
554ba183b1
commit
692bd2a02e
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user