aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2021-07-03 12:44:57 +0300
committerAlex Deucher <alexander.deucher@amd.com>2021-07-08 15:18:14 -0400
commit1d864f1088bbcf7f6ffa83053dcc8684a1a436cb (patch)
tree6a266e4074f287ca75910e314f4810d6bd7716cf /drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c
parent3006c9245542609d3a11b856b6d17cfce747ca88 (diff)
downloadlinux-1d864f1088bbcf7f6ffa83053dcc8684a1a436cb.tar.gz
linux-1d864f1088bbcf7f6ffa83053dcc8684a1a436cb.tar.bz2
linux-1d864f1088bbcf7f6ffa83053dcc8684a1a436cb.zip
drm/amdgpu: Fix signedness bug in __amdgpu_eeprom_xfer()
The i2c_transfer() function returns negatives or else the number of messages transferred. This code does not work because ARRAY_SIZE() is type size_t and so that means negative values of "r" are type promoted to high positive values which are greater than the ARRAY_SIZE(). Fix this by changing the < to != which works regardless of type promotion. Fixes: 746b584762e452 ("drm/amdgpu: Fixes to the AMDGPU EEPROM driver") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Luben Tuikov <luben.tuikov@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c')
0 files changed, 0 insertions, 0 deletions