mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Fix IIC "how" argument dereferencing on big-endian platforms
"how" argument is passed as value of int* pointer to callback function but dereferenced as char* so only one byte taken into into account. On little-endian systems it happens to work because first byte is LSB that contains actual value, on big-endian it's MSB and in this case it's always equal zero PR: 207786 Submitted by: chadf@triularity.org
This commit is contained in:
parent
74b8d63dcc
commit
71c1e74434
1 changed files with 1 additions and 1 deletions
|
|
@ -157,7 +157,7 @@ gpioiic_callback(device_t dev, int index, caddr_t data)
|
|||
int error, how;
|
||||
|
||||
how = GPIOBUS_DONTWAIT;
|
||||
if (data != NULL && (int)*data == IIC_WAIT)
|
||||
if (data != NULL && *(int*)data == IIC_WAIT)
|
||||
how = GPIOBUS_WAIT;
|
||||
error = 0;
|
||||
switch (index) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue