MdeModulePkg/AtaPassThru: Add missing NULL ptr check in BindingStart

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=916

Within function AtaAtapiPassThruStart():
Add missing NULL pointer check for variable 'Instance' under the
'ErrorExit' code logic.

Cc: Steven Shi <steven.shi@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
This commit is contained in:
Hao Wu 2018-06-28 09:12:52 +08:00
parent f6b0258d25
commit d374f2cdf9
1 changed files with 4 additions and 5 deletions

View File

@ -827,12 +827,11 @@ ErrorExit:
gBS->CloseEvent (Instance->TimerEvent);
}
//
// Remove all inserted ATA devices.
//
DestroyDeviceInfoList(Instance);
if (Instance != NULL) {
//
// Remove all inserted ATA devices.
//
DestroyDeviceInfoList (Instance);
FreePool (Instance);
}
return EFI_UNSUPPORTED;