mirror of
https://github.com/reactos/reactos.git
synced 2026-06-01 00:40:26 +08:00
[CMBATT] Grab the design voltage after the BIF data gets copied
There was a risk of accessing invalid data as the design voltage was grabbed before the read BIF data was copied into the device extension.
This commit is contained in:
@@ -280,7 +280,7 @@ CmBattVerifyStaticInfo(
|
||||
_In_ ULONG BatteryTag)
|
||||
{
|
||||
ACPI_BIF_DATA BifData;
|
||||
ULONG DesignVoltage = DeviceExtension->BifData.DesignVoltage;
|
||||
ULONG DesignVoltage;
|
||||
PBATTERY_INFORMATION Info = &DeviceExtension->BatteryInformation;
|
||||
NTSTATUS Status;
|
||||
|
||||
@@ -293,6 +293,7 @@ CmBattVerifyStaticInfo(
|
||||
RtlCopyMemory(Info->Chemistry, BifData.BatteryType, 4);
|
||||
// FIXME: take from _BIX method: Info->CycleCount
|
||||
DeviceExtension->BifData = BifData;
|
||||
DesignVoltage = DeviceExtension->BifData.DesignVoltage;
|
||||
|
||||
/* Check if the power stats are reported in ampere or watts */
|
||||
if (BifData.PowerUnit == ACPI_BATT_POWER_UNIT_AMPS)
|
||||
|
||||
Reference in New Issue
Block a user