[PATCH] i2c: s3c2410: Add SMBus emulation for block read

Wolfram Sang wsa at the-dreams.de
Mon Apr 15 12:06:51 EDT 2013


> I don't know if that can happen, but if the block has length 0 (that is,
> only consists of a single byte that is read as 0) the is_msglast() test
> returns 0 which might be wrong. Maybe even if it cannot regularily
> happen handle it in a sane way?

Length of 0 is illegal according to the specs, but a check won't hurt.

> Also I wonder if error checking for byte > I2C_SMBUS_BLOCK_MAX would be
> needed to prevent a buffer overrun?

Yes. Although I have seen devices able to send more than that, yet
adding support for that is a seperate issue.




More information about the linux-arm-kernel mailing list