Skip to content

Commit f019320

Browse files
aloheacGitLab
authored andcommitted
Increased I2C_SMBUS_BLOCK_MAX and added error handling for buffer overflow.
1 parent 3af3d13 commit f019320

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

i2c_smbus/i2c_smbus_amdadl.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,6 @@ s32 i2c_smbus_amdadl::i2c_xfer(u8 addr, char read_write, int* size, u8* data)
232232
ADLI2C I2Cstore;
233233
pI2C = &I2Cstore;
234234

235-
char i2c_buf[I2C_SMBUS_BLOCK_MAX];
236-
237235
pI2C->iSize = sizeof(ADLI2C);
238236
pI2C->iSpeed = 100;
239237
pI2C->iLine = 1; //location of the Aura chip
@@ -256,9 +254,7 @@ s32 i2c_smbus_amdadl::i2c_xfer(u8 addr, char read_write, int* size, u8* data)
256254
else
257255
{
258256
pI2C->iAction = ADL_DL_I2C_ACTIONWRITE;
259-
pI2C->pcData = i2c_buf;
260-
261-
memcpy(i2c_buf, data, data_size);
257+
pI2C->pcData = (char*)data;
262258

263259
ret = ADL2_Display_WriteAndReadI2C(context, PrimaryDisplay, pI2C);
264260
}

0 commit comments

Comments
 (0)