]> git.openfabrics.org - ~shefty/rdma-win.git/commitdiff
[MTHCA] bugfix: unaligned structure causes crash on IA64
authorleonidk <leonidk@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Sun, 19 Aug 2007 08:20:26 +0000 (08:20 +0000)
committerleonidk <leonidk@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Sun, 19 Aug 2007 08:20:26 +0000 (08:20 +0000)
git-svn-id: svn://openib.tc.cornell.edu/gen1@773 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

trunk/hw/mthca/kernel/hca_verbs.c

index aa6c5ab276bc984c6f4a75db0dc84f10043177d3..2afd30bdb35a500c49ceb6b9d8366c950c176ac7 100644 (file)
@@ -182,7 +182,7 @@ mlnx_query_ca (
                PTR_ALIGN(sizeof(uint32_t) * num_page_sizes) +\r
                PTR_ALIGN(sizeof(ib_port_attr_t) * num_ports)+\r
                PTR_ALIGN(MTHCA_BOARD_ID_LEN)+\r
-               sizeof(uplink_info_t);  /* uplink info */\r
+               PTR_ALIGN(sizeof(uplink_info_t));       /* uplink info */\r
        \r
        // get port properties\r
        for (port_num = 0; port_num <= end_port(ib_dev) - start_port(ib_dev); ++port_num) {\r
@@ -240,7 +240,7 @@ mlnx_query_ca (
        cl_memcpy(last_p,to_mdev(ib_dev)->board_id, MTHCA_BOARD_ID_LEN);\r
        last_p += PTR_ALIGN(MTHCA_BOARD_ID_LEN);\r
        *(uplink_info_t*)last_p = to_mdev(ib_dev)->uplink_info;\r
-       last_p += sizeof(uplink_info_t);        /* uplink info */\r
+       last_p += PTR_ALIGN(sizeof(uplink_info_t));     /* uplink info */\r
        \r
        // Separate the loops to ensure that table pointers are always setup\r
        for (port_num = 0; port_num < num_ports; port_num++) {\r