drm/amdgpu: fix the warning bad bit shift operation for aca_error_type type
[ Upstream commit e6ae021adb ]
Filter invalid aca error types before performing a shift operation.
Signed-off-by: Jesse Zhang <Jesse.Zhang@amd.com>
Reviewed-by: Yang Wang <kevinyang.wang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
130c2dc75c
commit
7b56041e73
@@ -534,7 +534,7 @@ int amdgpu_aca_get_error_data(struct amdgpu_device *adev, struct aca_handle *han
|
||||
if (aca_handle_is_valid(handle))
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
if (!(BIT(type) & handle->mask))
|
||||
if ((type < 0) || (!(BIT(type) & handle->mask)))
|
||||
return 0;
|
||||
|
||||
return __aca_get_error_data(adev, handle, type, err_data, qctx);
|
||||
|
||||
Reference in New Issue
Block a user