drm/amd/pm: fix variable dereferenced issue in amdgpu_device_attr_create()
[ Upstream commit
25e6373a5b8efc623443f2699d2b929bf3067d76 ]
- fix variable ('attr') dereferenced issue.
- using condition check instead of BUG_ON().
Fixes:
4e01847c38f7 ("drm/amdgpu: optimize amdgpu device attribute code")
Cc: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Yang Wang <kevinyang.wang@amd.com>
Reviewed-by: Kenneth Feng <kenneth.feng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>