From f6813b826be8188e06a8d1f4134668ed6a01f158 Mon Sep 17 00:00:00 2001 From: leonidk Date: Sun, 19 Aug 2007 08:20:26 +0000 Subject: [PATCH] [MTHCA] bugfix: unaligned structure causes crash on IA64 git-svn-id: svn://openib.tc.cornell.edu/gen1@773 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86 --- trunk/hw/mthca/kernel/hca_verbs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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++) { -- 2.41.0