From 4c7e997ef1c81be69e6b4a8e2fa8cec013ee0d5f Mon Sep 17 00:00:00 2001 From: Elvin Li Date: Fri, 28 Mar 2014 02:34:31 +0000 Subject: [PATCH] Add NULL pointer check in I2chost. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Elvin Li Reviewed-by: Eric Dong git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15408 6f19259b-4bc3-4df7-8a09-765794883524 --- MdeModulePkg/Bus/I2c/I2cDxe/I2cHost.c | 1 + 1 file changed, 1 insertion(+) diff --git a/MdeModulePkg/Bus/I2c/I2cDxe/I2cHost.c b/MdeModulePkg/Bus/I2c/I2cDxe/I2cHost.c index 0cc8e33842..ff99fe4461 100644 --- a/MdeModulePkg/Bus/I2c/I2cDxe/I2cHost.c +++ b/MdeModulePkg/Bus/I2c/I2cDxe/I2cHost.c @@ -1012,6 +1012,7 @@ I2cHostQueueRequest ( // RequestPacketSize = sizeof (UINTN) + RequestPacket->OperationCount * sizeof (EFI_I2C_OPERATION); I2cRequest->RequestPacket = AllocateZeroPool (RequestPacketSize); + ASSERT (I2cRequest->RequestPacket != NULL); CopyMem (I2cRequest->RequestPacket, RequestPacket, RequestPacketSize); //