Re: [PATCH v4] i2c: i801: Allow ACPI SystemIO OpRegion to conflict with PCI BAR

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Mika,

On Fri, 13 May 2016 15:45:55 +0300, Mika Westerberg wrote:
> +	if (function == ACPI_READ)
> +		status = acpi_os_read_port(address, (u32 *)value, bits);
> +	else
> +		status = acpi_os_write_port(address, (u32)*value, bits);

Jeremy McNicoll at RedHat brought to my attention that this may not be
safe. This assumes that function is either exactly ACPI_READ or exactly
ACPI_WRITE. However function is a 32-bit bitfield if I understand
correctly.

Shouldn't it instead be:

	if ((function & ACPI_IO_MASK) == ACPI_READ)

as drivers exfldio, acpi_ipmi and i2c-core do? Maybe it makes no
difference if other bits are never used, but maybe they will be in the
future.

Thanks,
-- 
Jean Delvare
SUSE L3 Support
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux