diff mbox

[1/2] opensm/osm_pkey_mgr.c: In pkey_mgr_update_peer_port, initialize p_peer_pkey_tbl later in flow

Message ID 4D9B59CB.9080102@dev.mellanox.co.il (mailing list archive)
State Accepted
Headers show

Commit Message

Hal Rosenstock April 5, 2011, 6:04 p.m. UTC
Closer to where initially used

Signed-off-by: Hal Rosenstock <hal@mellanox.com>
---
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Alex Netes April 7, 2011, 5:03 p.m. UTC | #1
On 14:04 Tue 05 Apr     , Hal Rosenstock wrote:
> 
> Closer to where initially used
> 
> Signed-off-by: Hal Rosenstock <hal@mellanox.com>
> ---

Applied, thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/opensm/osm_pkey_mgr.c b/opensm/osm_pkey_mgr.c
index 92f8f2b..78e8f83 100644
--- a/opensm/osm_pkey_mgr.c
+++ b/opensm/osm_pkey_mgr.c
@@ -402,7 +402,6 @@  static int pkey_mgr_update_peer_port(osm_log_t * p_log, osm_sm_t * sm,
 		return 0;
 
 	p_pkey_tbl = osm_physp_get_pkey_tbl(p_physp);
-	p_peer_pkey_tbl = &peer->pkeys;
 	peer_max_blocks = pkey_mgr_get_physp_max_blocks(peer);
 	if (peer_max_blocks < p_pkey_tbl->used_blocks) {
 		OSM_LOG(p_log, OSM_LOG_ERROR, "ERR 0508: "
@@ -424,6 +423,7 @@  static int pkey_mgr_update_peer_port(osm_log_t * p_log, osm_sm_t * sm,
 
 	memset(&empty_block, 0, sizeof(ib_pkey_table_t));
 
+	p_peer_pkey_tbl = &peer->pkeys;
 	p_peer_pkey_tbl->used_blocks = p_pkey_tbl->used_blocks;
 	for (block_index = 0; block_index < p_pkey_tbl->used_blocks;
 	     block_index++) {