]> git.proxmox.com Git - mirror_edk2.git/commit
MdeModulePkg NvmExpressDxe: Avoid crashing 'Mode' during OpenProtocol
authorHao Wu <hao.a.wu@intel.com>
Fri, 26 Aug 2016 06:39:37 +0000 (14:39 +0800)
committerHao Wu <hao.a.wu@intel.com>
Tue, 6 Sep 2016 07:31:12 +0000 (15:31 +0800)
commit6fe39780140f9f429c97a71ca3bfa4e16e779793
tree8bfc79e662e3f84e99277cb94fc36d537a08c4a0
parentbc54e50e0fe03c570014f363b547426913e92449
MdeModulePkg NvmExpressDxe: Avoid crashing 'Mode' during OpenProtocol

The gBS->OpenProtocol() calls to open EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL
in NvmExpress.c will crash the data in 'Mode' field of
'Private->Passthru'.

The third parameter of gBS->OpenProtocol() is an output parameter that
stores the address where a pointer to the corresponding Protocol
Interface. The current code mistakenly pass '&Private->Passthru' (a
pointer of the EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL) as the third
parameter. This will crash the data in 'Mode' filed.

Cc: Feng Tian <feng.tian@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpress.c