au-ts / sddf

A collection of interfaces, libraries and tools for writing device drivers for seL4 that allow accessing devices securely and with low overhead.
Other
23 stars 18 forks source link

drivers/i2c/meson: fix undefined behaviour #291

Closed Ivan-Velickovic closed 1 week ago

Ivan-Velickovic commented 1 week ago

In i2c_load_tokens we're bit-shifting the value of data by potentially more than 8-bits which is undefined behaviour in C if data is uint8_t.

To fix this, we can just make data a uint32_t which makes sense since wdata0 is also uint32_t.