drm/amdgpu: Fixed warning reported by kernel test robot
authoryipechai <YiPeng.Chai@amd.com>
Wed, 23 Feb 2022 03:05:43 +0000 (11:05 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 23 Feb 2022 19:26:35 +0000 (14:26 -0500)
Fixed warning reported by kernel test robot:
1.warning: variable 'ras_obj' is used uninitialized
  whenever '||' condition is true.

Signed-off-by: yipechai <YiPeng.Chai@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c

index 0e89175ee0a96a9e81c52cc3213b3e3cfda27abd..b53abc15a830414aba878106e7ac889a79632721 100644 (file)
@@ -2400,7 +2400,7 @@ bool amdgpu_ras_is_poison_mode_supported(struct amdgpu_device *adev)
 int amdgpu_ras_block_late_init(struct amdgpu_device *adev,
                         struct ras_common_if *ras_block)
 {
-       struct amdgpu_ras_block_object *ras_obj;
+       struct amdgpu_ras_block_object *ras_obj = NULL;
        struct amdgpu_ras *con = amdgpu_ras_get_context(adev);
        unsigned long ue_count, ce_count;
        int r;