i2c: xlp9xx: Make sure the transfer size is not more than I2C_SMBUS_BLOCK_SIZE
For SMBus transactions the max permissible transfer size is I2C_SMBUS_BLOCK_SIZE. It is possible that some clients might not follow it strictly occasionally. This would lead to stack corruption if the driver copies more than I2C_SMBUS_BLOCK_SIZE bytes. Add a check to avoid such conditions. Signed-off-by: NJayachandran C <jnair@caviumnetworks.com> Signed-off-by: NGeorge Cherian <george.cherian@cavium.com> Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
Showing
想要评论请 注册 或 登录