linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCHv2} opensm/osm_torus.c: Fix crash in torus_update_osm_vlarb
@ 2012-12-03 21:25 Hal Rosenstock
       [not found] ` <50BD18CA.8040409-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Hal Rosenstock @ 2012-12-03 21:25 UTC (permalink / raw)
  To: Alex Netes
  Cc: linux-rdma (linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org),
	Jim Schutt


Signed-off-by: Alex Netes <alexne-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Signed-off-by: Hal Rosenstock <hal-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
---
Change since v1:
Fixed NULL pointer check on sw->port[port_num]
Pointed out by: Jim Schutt <jaschut-4OHPYypu0djtX7QSmKvirg@public.gmane.org>

 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;
  
-- 
1.7.8.2

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCHv2} opensm/osm_torus.c: Fix crash in torus_update_osm_vlarb
       [not found] ` <50BD18CA.8040409-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
@ 2012-12-03 21:28   ` Jim Schutt
  0 siblings, 0 replies; 2+ messages in thread
From: Jim Schutt @ 2012-12-03 21:28 UTC (permalink / raw)
  To: Hal Rosenstock
  Cc: Alex Netes,
	linux-rdma (linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org)

On 12/03/2012 02:25 PM, Hal Rosenstock wrote:
>
> Signed-off-by: Alex Netes<alexne-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> Signed-off-by: Hal Rosenstock<hal-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>

Acked-by: Jim Schutt <jaschut-4OHPYypu0djtX7QSmKvirg@public.gmane.org>

> ---
> Change since v1:
> Fixed NULL pointer check on sw->port[port_num]
> Pointed out by: Jim Schutt<jaschut-4OHPYypu0djtX7QSmKvirg@public.gmane.org>
>
>   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-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-12-03 21:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-03 21:25 [PATCHv2} opensm/osm_torus.c: Fix crash in torus_update_osm_vlarb Hal Rosenstock
     [not found] ` <50BD18CA.8040409-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2012-12-03 21:28   ` Jim Schutt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).