[IBAL] Handle acquire_ca failing in create_iou
[mirror/winof/.git] / core / al / al_dm.c
index b823705..9d95fa6 100644 (file)
@@ -1066,6 +1066,14 @@ create_iou(
 \r
        /* It is now safe to acquire the CA and initialize the p_ci_ca pointer. */\r
        h_ca = acquire_ca( p_pnp_rec->guid );\r
+       if( !h_ca )\r
+       {\r
+               p_iou->obj.pfn_destroy( &p_iou->obj, NULL );\r
+               AL_TRACE_EXIT( AL_DBG_ERROR,\r
+                       ("acquire_ca for GUID %016I64x failed.\n", p_pnp_rec->guid) );\r
+               return IB_INVALID_CA_HANDLE;\r
+       }\r
+\r
        p_iou->obj.p_ci_ca = h_ca->obj.p_ci_ca;\r
 \r
        /* Initialize the IO unit IOC list. */\r