diff mbox

[PATCHv2} opensm/osm_torus.c: Fix crash in torus_update_osm_vlarb

Message ID 50BD18CA.8040409@dev.mellanox.co.il (mailing list archive)
State Accepted
Delegated to: Alex Netes
Headers show

Commit Message

Hal Rosenstock Dec. 3, 2012, 9:25 p.m. UTC
Signed-off-by: Alex Netes <alexne@mellanox.com>
Signed-off-by: Hal Rosenstock <hal@mellanox.com>
---
Change since v1:
Fixed NULL pointer check on sw->port[port_num]
Pointed out by: Jim Schutt <jaschut@sandia.gov>

 opensm/osm_torus.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

Jim Schutt Dec. 3, 2012, 9:28 p.m. UTC | #1
On 12/03/2012 02:25 PM, Hal Rosenstock wrote:
>
> Signed-off-by: Alex Netes<alexne@mellanox.com>
> Signed-off-by: Hal Rosenstock<hal@mellanox.com>

Acked-by: Jim Schutt <jaschut@sandia.gov>

> ---
> Change since v1:
> Fixed NULL pointer check on sw->port[port_num]
> Pointed out by: Jim Schutt<jaschut@sandia.gov>
>
>   opensm/osm_torus.c |    2 +-
>   1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/opensm/osm_torus.c b/opensm/osm_torus.c
> index c06f8d4..075f84a 100644
> --- a/opensm/osm_torus.c
> +++ b/opensm/osm_torus.c
> @@ -8089,7 +8089,7 @@ void torus_update_osm_vlarb(void *context, osm_physp_t *osm_phys_port,
>   	 * So, leave VL 0 alone, remap VL 4 to VL 1, zero out the rest,
>   	 * and compress out the zero entries to the end.
>   	 */
> -	if (!sw || !port_num ||
> +	if (!sw || !port_num || !sw->port[port_num] ||
>   	    sw->port[port_num]->pgrp->port_grp != 2 * TORUS_MAX_DIM)
>   		return;
>


--
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_torus.c b/opensm/osm_torus.c
index c06f8d4..075f84a 100644
--- a/opensm/osm_torus.c
+++ b/opensm/osm_torus.c
@@ -8089,7 +8089,7 @@  void torus_update_osm_vlarb(void *context, osm_physp_t *osm_phys_port,
 	 * So, leave VL 0 alone, remap VL 4 to VL 1, zero out the rest,
 	 * and compress out the zero entries to the end.
 	 */
-	if (!sw || !port_num ||
+	if (!sw || !port_num || !sw->port[port_num] ||
 	    sw->port[port_num]->pgrp->port_grp != 2 * TORUS_MAX_DIM)
 		return;