MdeModulePkg/NvmExpress: Fix mem leak in error handling of Start()

Memory pointed to by Private->ControllerData has not been freed up
correctly at error handling path.

Cc: Simon (Xiang) Lian-SSI <simon.lian@ssi.samsung.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Feng Tian <feng.tian@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Simon (Xiang) Lian-SSI <simon.lian@ssi.samsung.com>
This commit is contained in:
Tian Feng 2015-11-24 14:35:28 +08:00 committed by Feng Tian
parent bd2388ab12
commit ac231001f5
1 changed files with 4 additions and 0 deletions

View File

@ -847,6 +847,10 @@ Exit:
PciIo->FreeBuffer (PciIo, 4, Private->Buffer); PciIo->FreeBuffer (PciIo, 4, Private->Buffer);
} }
if ((Private != NULL) && (Private->ControllerData != NULL)) {
FreePool (Private->ControllerData);
}
if (Private != NULL) { if (Private != NULL) {
FreePool (Private); FreePool (Private);
} }