mirror of https://github.com/acidanthera/audk.git
MdeModulePkg/PciBusDxe: Fix possible uninitialized use
If the function gets invalid value for the `ResizableBarOp` parameter and asserts are disabled, `Bit` can be used uninitialized. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Ray Ni <ray.ni@intel.com> Signed-off-by: Sergei Dmitrouk <sergei@posteo.net> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
This commit is contained in:
parent
aecfbc81a9
commit
4c79f9bc20
|
@ -1778,10 +1778,9 @@ PciProgramResizableBar (
|
|||
|
||||
if (ResizableBarOp == PciResizableBarMax) {
|
||||
Bit = HighBitSet64(Capabilities);
|
||||
} else if (ResizableBarOp == PciResizableBarMin) {
|
||||
Bit = LowBitSet64(Capabilities);
|
||||
} else {
|
||||
ASSERT ((ResizableBarOp == PciResizableBarMax) || (ResizableBarOp == PciResizableBarMin));
|
||||
ASSERT (ResizableBarOp == PciResizableBarMin);
|
||||
Bit = LowBitSet64(Capabilities);
|
||||
}
|
||||
|
||||
ASSERT (Bit >= 0);
|
||||
|
|
Loading…
Reference in New Issue