Skip to contentSkip to conversation

infiniband:Fix error handling in the function cm_init_av_by_path

PATCH Hefty, Sean 1 participant 1 message Sep 8, 2015 1 message not in the archive InfiniBand

lore
Share & tools
lore

Hefty, Sean

author Acked-by
#1 lore raw
In reply to a message not in the archive
Quoted 8 lines

This fixes error handling in the function cm_init_av_by_path to properly check if the internal call to the function ib_init_ah_from_path has failed by returning a error code and if so return immediately to the caller with this error code in order to signal/allow the caller to handle the error in its own intended error paths.

Quoted 24 lines
---
 drivers/infiniband/core/cm.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/infiniband/core/cm.c +4 -3
index 3a972eb..cb021fd 100644
@@ -379,8 +379,10 @@ static int cm_init_av_by_path(struct ib_sa_path_rec
 *path, struct cm_av *av)
 		return ret;
 
 	av->port = port;
-	ib_init_ah_from_path(cm_dev->ib_device, port->port_num, path,
-			     &av->ah_attr);
+	ret = ib_init_ah_from_path(cm_dev->ib_device, port->port_num, path,
+				   &av->ah_attr);
+	if (ret)
+		return ret;
 	av->timeout = path->packet_life_time + 1;
 	memcpy(av->smac, path->smac, sizeof(av->smac));
 
--

2.1.4