RE: [PATCH] infiniband:Fix error handling in the function cm_init_av_by_path
From: Hefty, Sean
Date: Tue Sep 08 2015 - 12:42:43 EST
> 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.
>
> Signed-off-by: Nicholas Krause <xerofoify@xxxxxxxxx>
Acked-by: Sean Hefty <sean.hefty@xxxxxxxxx>
> ---
> drivers/infiniband/core/cm.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c
> index 3a972eb..cb021fd 100644
> --- a/drivers/infiniband/core/cm.c
> +++ b/drivers/infiniband/core/cm.c
> @@ -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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/