From: Ben Chalmers Date: Mon, 23 Apr 2018 08:46:39 +0000 (+0100) Subject: Check Mdl, not Controller->Mdl for allocation failure X-Git-Tag: 9.0.0-rc1~35 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=d92604b8184b93a06754ea730582f17cdece833a;p=pvdrivers%2Fwin%2Fxenvif.git Check Mdl, not Controller->Mdl for allocation failure Ensure we fall through error handlers, rather than BSOD. Signed-off-by: Ben Chalmers Also fix another instance of the incorrect check. Signed-off-by: Paul Durrant --- diff --git a/src/xenvif/controller.c b/src/xenvif/controller.c index 004bccb..35901a2 100644 --- a/src/xenvif/controller.c +++ b/src/xenvif/controller.c @@ -901,7 +901,7 @@ ControllerSetHashKey( Mdl = __AllocatePage(); status = STATUS_NO_MEMORY; - if (Controller->Mdl == NULL) + if (Mdl == NULL) goto fail1; ASSERT(Mdl->MdlFlags & MDL_MAPPED_TO_SYSTEM_VA); @@ -1080,7 +1080,7 @@ ControllerSetHashMapping( Mdl = __AllocatePage(); status = STATUS_NO_MEMORY; - if (Controller->Mdl == NULL) + if (Mdl == NULL) goto fail2; ASSERT(Mdl->MdlFlags & MDL_MAPPED_TO_SYSTEM_VA);