infiniband:Fix error handling in the function cm_init_av_by_path
Hefty, Sean
Acked-byQuoted 8 lines
This fixes error handling in the function
cm_init_av_by_pathto properly check if the internal call to the functionib_init_ah_from_pathhas 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.Signed-off-by Nicholas Krause <[email protected]>
Acked-by Sean Hefty <[email protected]>
Quoted 24 lines
--- drivers/infiniband/core/cm.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)drivers/infiniband/core/cm.c +4
-3@@ -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