mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 20:45:44 +00: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:
parent
ea8315ba56
commit
f3dd15ad64
1 changed files with 2 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue