summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c
diff options
context:
space:
mode:
authorSuman Prakash <suman.p@samsung.com>2017-03-20 16:34:55 +0800
committerHao Wu <hao.a.wu@intel.com>2017-03-21 10:01:44 +0800
commitf2333c707dd04f069c102bcae004561ec590a3a0 (patch)
tree6d241870cf648288f0cfe50a1589eb7c797d4ce1 /MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c
parent38b15ebe4fd5888493131d30fc31833a5e9a7d36 (diff)
downloadedk2-f2333c707dd04f069c102bcae004561ec590a3a0.tar.gz
edk2-f2333c707dd04f069c102bcae004561ec590a3a0.tar.bz2
edk2-f2333c707dd04f069c102bcae004561ec590a3a0.zip
MdeModulePkg/NvmExpressDxe: Memory leak fix in async code flow
For async commands, the buffer allocated for Prp list is not getting freed, which will cause memory leak for async read write command. For example testing async command flow with custom application to send multiple read write commands were resulting in decrease of available memory page in memmap, which eventually resulted in system hang. Hence freeing AsyncRequest->MapData, AsyncRequest->MapMeta, AsyncRequest->MapPrpList and AsyncRequest->PrpListHost when async command is completed. Cc: Feng Tian <feng.tian@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Suman Prakash <suman.p@samsung.com.com> Reviewed-by: Hao Wu <hao.a.wu@intel.com>
Diffstat (limited to 'MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c')
-rw-r--r--MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c b/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c
index 2c30009945..ef3d772cc2 100644
--- a/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c
+++ b/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c
@@ -627,6 +627,11 @@ NvmExpressPassThru (
AsyncRequest->Packet = Packet;
AsyncRequest->CommandId = Sq->Cid;
AsyncRequest->CallerEvent = Event;
+ AsyncRequest->MapData = MapData;
+ AsyncRequest->MapMeta = MapMeta;
+ AsyncRequest->MapPrpList = MapPrpList;
+ AsyncRequest->PrpListNo = PrpListNo;
+ AsyncRequest->PrpListHost = PrpListHost;
OldTpl = gBS->RaiseTPL (TPL_NOTIFY);
InsertTailList (&Private->AsyncPassThruQueue, &AsyncRequest->Link);