Skip to content

Commit

Permalink
MdeModulePkg/AtaPassThru: Add missing NULL ptr check in BindingStart
Browse files Browse the repository at this point in the history
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 <[email protected]>
Cc: Eric Dong <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Hao Wu <[email protected]>
Reviewed-by: Star Zeng <[email protected]>
hwu25 committed Jun 29, 2018
1 parent f6b0258 commit d374f2c
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c
Original file line number Diff line number Diff line change
@@ -827,12 +827,11 @@ AtaAtapiPassThruStart (
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;

0 comments on commit d374f2c

Please sign in to comment.