Merge pull request #4401 from howard0su/i2c_security
Return when i2c transfer 0 messages
This commit is contained in:
commit
339ebf3c16
|
@ -375,6 +375,8 @@ static rt_size_t i2c_bit_xfer(struct rt_i2c_bus_device *bus,
|
||||||
rt_int32_t i, ret;
|
rt_int32_t i, ret;
|
||||||
rt_uint16_t ignore_nack;
|
rt_uint16_t ignore_nack;
|
||||||
|
|
||||||
|
if (num == 0) return 0;
|
||||||
|
|
||||||
for (i = 0; i < num; i++)
|
for (i = 0; i < num; i++)
|
||||||
{
|
{
|
||||||
msg = &msgs[i];
|
msg = &msgs[i];
|
||||||
|
|
Loading…
Reference in New Issue