[IBBUS] clear IOU PDO device extension memory before use.
authorstansmith <stansmith@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Tue, 19 May 2009 19:48:10 +0000 (19:48 +0000)
committerstansmith <stansmith@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Tue, 19 May 2009 19:48:10 +0000 (19:48 +0000)
git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@2190 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

core/bus/kernel/bus_iou_mgr.c

index 8643df8..4e9a120 100644 (file)
@@ -729,6 +729,9 @@ iou_mgr_iou_add(
                return IB_ERROR;\r
        }\r
 \r
                return IB_ERROR;\r
        }\r
 \r
+       p_iou_ext = p_pdo->DeviceExtension;\r
+       memset( p_iou_ext, 0, sizeof(bus_iou_ext_t) );\r
+\r
        /* Initialize the device extension. */\r
        cl_init_pnp_po_ext( p_pdo, NULL, p_pdo, bus_globals.dbg_lvl,\r
                                                &vfptr_iou_pnp, &vfptr_iou_query_txt );\r
        /* Initialize the device extension. */\r
        cl_init_pnp_po_ext( p_pdo, NULL, p_pdo, bus_globals.dbg_lvl,\r
                                                &vfptr_iou_pnp, &vfptr_iou_query_txt );\r
@@ -736,7 +739,6 @@ iou_mgr_iou_add(
        /* Set the DO_BUS_ENUMERATED_DEVICE flag to mark it as a PDO. */\r
        p_pdo->Flags |= DO_BUS_ENUMERATED_DEVICE;\r
        \r
        /* Set the DO_BUS_ENUMERATED_DEVICE flag to mark it as a PDO. */\r
        p_pdo->Flags |= DO_BUS_ENUMERATED_DEVICE;\r
        \r
-       p_iou_ext = p_pdo->DeviceExtension;\r
        p_iou_ext->pdo.dev_po_state.DeviceState = PowerDeviceD0;\r
        p_iou_ext->pdo.p_parent_ext = p_bfi->p_bus_ext;\r
        p_iou_ext->pdo.b_present = TRUE;\r
        p_iou_ext->pdo.dev_po_state.DeviceState = PowerDeviceD0;\r
        p_iou_ext->pdo.p_parent_ext = p_bfi->p_bus_ext;\r
        p_iou_ext->pdo.b_present = TRUE;\r