mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 02:50:49 +09:00
drm/amdgpu: update type of buf size to u32 for eeprom functions
[ Upstream commit 2aadb520bfacec12527effce3566f8df55e5d08e ] Avoid overflow issue. Signed-off-by: Tao Zhou <tao.zhou1@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
1111076d91
commit
369cfc6352
@@ -179,7 +179,7 @@ static int __amdgpu_eeprom_xfer(struct i2c_adapter *i2c_adap, u32 eeprom_addr,
|
|||||||
* Returns the number of bytes read/written; -errno on error.
|
* Returns the number of bytes read/written; -errno on error.
|
||||||
*/
|
*/
|
||||||
static int amdgpu_eeprom_xfer(struct i2c_adapter *i2c_adap, u32 eeprom_addr,
|
static int amdgpu_eeprom_xfer(struct i2c_adapter *i2c_adap, u32 eeprom_addr,
|
||||||
u8 *eeprom_buf, u16 buf_size, bool read)
|
u8 *eeprom_buf, u32 buf_size, bool read)
|
||||||
{
|
{
|
||||||
const struct i2c_adapter_quirks *quirks = i2c_adap->quirks;
|
const struct i2c_adapter_quirks *quirks = i2c_adap->quirks;
|
||||||
u16 limit;
|
u16 limit;
|
||||||
@@ -226,7 +226,7 @@ static int amdgpu_eeprom_xfer(struct i2c_adapter *i2c_adap, u32 eeprom_addr,
|
|||||||
|
|
||||||
int amdgpu_eeprom_read(struct i2c_adapter *i2c_adap,
|
int amdgpu_eeprom_read(struct i2c_adapter *i2c_adap,
|
||||||
u32 eeprom_addr, u8 *eeprom_buf,
|
u32 eeprom_addr, u8 *eeprom_buf,
|
||||||
u16 bytes)
|
u32 bytes)
|
||||||
{
|
{
|
||||||
return amdgpu_eeprom_xfer(i2c_adap, eeprom_addr, eeprom_buf, bytes,
|
return amdgpu_eeprom_xfer(i2c_adap, eeprom_addr, eeprom_buf, bytes,
|
||||||
true);
|
true);
|
||||||
@@ -234,7 +234,7 @@ int amdgpu_eeprom_read(struct i2c_adapter *i2c_adap,
|
|||||||
|
|
||||||
int amdgpu_eeprom_write(struct i2c_adapter *i2c_adap,
|
int amdgpu_eeprom_write(struct i2c_adapter *i2c_adap,
|
||||||
u32 eeprom_addr, u8 *eeprom_buf,
|
u32 eeprom_addr, u8 *eeprom_buf,
|
||||||
u16 bytes)
|
u32 bytes)
|
||||||
{
|
{
|
||||||
return amdgpu_eeprom_xfer(i2c_adap, eeprom_addr, eeprom_buf, bytes,
|
return amdgpu_eeprom_xfer(i2c_adap, eeprom_addr, eeprom_buf, bytes,
|
||||||
false);
|
false);
|
||||||
|
|||||||
@@ -28,10 +28,10 @@
|
|||||||
|
|
||||||
int amdgpu_eeprom_read(struct i2c_adapter *i2c_adap,
|
int amdgpu_eeprom_read(struct i2c_adapter *i2c_adap,
|
||||||
u32 eeprom_addr, u8 *eeprom_buf,
|
u32 eeprom_addr, u8 *eeprom_buf,
|
||||||
u16 bytes);
|
u32 bytes);
|
||||||
|
|
||||||
int amdgpu_eeprom_write(struct i2c_adapter *i2c_adap,
|
int amdgpu_eeprom_write(struct i2c_adapter *i2c_adap,
|
||||||
u32 eeprom_addr, u8 *eeprom_buf,
|
u32 eeprom_addr, u8 *eeprom_buf,
|
||||||
u16 bytes);
|
u32 bytes);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user