From: leonidk Date: Sun, 19 Aug 2007 08:20:26 +0000 (+0000) Subject: [MTHCA] bugfix: unaligned structure causes crash on IA64 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=f6813b826be8188e06a8d1f4134668ed6a01f158;p=~shefty%2Frdma-win.git [MTHCA] bugfix: unaligned structure causes crash on IA64 git-svn-id: svn://openib.tc.cornell.edu/gen1@773 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86 --- diff --git a/trunk/hw/mthca/kernel/hca_verbs.c b/trunk/hw/mthca/kernel/hca_verbs.c index aa6c5ab2..2afd30bd 100644 --- a/trunk/hw/mthca/kernel/hca_verbs.c +++ b/trunk/hw/mthca/kernel/hca_verbs.c @@ -182,7 +182,7 @@ mlnx_query_ca ( PTR_ALIGN(sizeof(uint32_t) * num_page_sizes) + PTR_ALIGN(sizeof(ib_port_attr_t) * num_ports)+ PTR_ALIGN(MTHCA_BOARD_ID_LEN)+ - sizeof(uplink_info_t); /* uplink info */ + PTR_ALIGN(sizeof(uplink_info_t)); /* uplink info */ // get port properties for (port_num = 0; port_num <= end_port(ib_dev) - start_port(ib_dev); ++port_num) { @@ -240,7 +240,7 @@ mlnx_query_ca ( cl_memcpy(last_p,to_mdev(ib_dev)->board_id, MTHCA_BOARD_ID_LEN); last_p += PTR_ALIGN(MTHCA_BOARD_ID_LEN); *(uplink_info_t*)last_p = to_mdev(ib_dev)->uplink_info; - last_p += sizeof(uplink_info_t); /* uplink info */ + last_p += PTR_ALIGN(sizeof(uplink_info_t)); /* uplink info */ // Separate the loops to ensure that table pointers are always setup for (port_num = 0; port_num < num_ports; port_num++) {