This fixes a bug due to which failover from secondary path back to primary path
was not working.

Signed-off-by: Ramachandra K <ramachandra.kuchimanchi@qlogic.com>
---

 drivers/infiniband/ulp/vnic/vnic_ib.c   |    4 +++-
 drivers/infiniband/ulp/vnic/vnic_main.c |    9 +++++----
 2 files changed, 8 insertions(+), 5 deletions(-)

diff -r b3ccdb3dc8f5 drivers/infiniband/ulp/vnic/vnic_ib.c
--- a/drivers/infiniband/ulp/vnic/vnic_ib.c	Tue Jan 23 15:20:34 2007 -0800
+++ b/drivers/infiniband/ulp/vnic/vnic_ib.c	Tue Jan 23 15:26:52 2007 -0800
@@ -303,10 +303,12 @@ int vnic_ib_get_path(struct netpath *net
 			       " path record query\n",
 			       config->path_info.status);
 
+		ret = config->path_info.status;
+	}
+out:
+	if (ret)
 		netpath_timer(netpath, vnic->config->no_path_timeout);
-		ret = config->path_info.status;
-	}
-out:
+
 	return ret;
 }
 
diff -r b3ccdb3dc8f5 drivers/infiniband/ulp/vnic/vnic_main.c
--- a/drivers/infiniband/ulp/vnic/vnic_main.c	Tue Jan 23 15:20:34 2007 -0800
+++ b/drivers/infiniband/ulp/vnic/vnic_main.c	Tue Jan 23 15:30:09 2007 -0800
@@ -710,7 +710,7 @@ static struct vnic * vnic_handle_npevent
 	case VNIC_PRINP_TIMEREXPIRED:
 		netpath = &vnic->primary_path;
 		netpath->timer_state = NETPATH_TS_EXPIRED;
-		if (netpath->carrier)
+		if (!netpath->carrier)
 			update_path_and_reconnect(netpath, vnic);
 		break;
 	case VNIC_SECNP_TIMEREXPIRED:
