Skip to contentSkip to conversation

drm/amdgpu: add amdgpu_ras.c to support ras (v2)

bug report Dan Carpenter 1 participant 1 message Mar 20, 2019

lore
Share & tools
lore
#0 lore raw

Hello xinhui pan,

This is a semi-automatic email about new static checker warnings.

The patch dbd249c24427: "drm/amdgpu: add amdgpu_ras.c to support ras (v2)" from Oct 31, 2018, leads to the following Smatch complaint:

drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c:1215 amdgpu_ras_add_bad_pages()
warn: variable dereferenced before check 'con' (see line 1211)

drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c:1247 amdgpu_ras_reserve_bad_pages()
warn: variable dereferenced before check 'con' (see line 1242)

drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
1210 struct amdgpu_ras *con = amdgpu_ras_get_context(adev);

  1211		struct ras_err_handler_data *data = con->eh_data;
                                                    ^^^^^^^^^^^^

Dereference

1212 int i = pages;
1213 int ret = 0;
1214
1215 if (!con || !data || !bps || pages <= 0)

                    ^^^^

Check

1216 return 0;
1217

regards,
dan carpenter
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx