Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1228123 > unrolled thread

RE: [PATCH] infiniband:core:Fix error handling in the function cm_lap_handler

Started by"Hefty, Sean" <sean.hefty@intel.com>
First post2015-09-18 18:20 +0200
Last post2015-09-18 18:20 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  RE: [PATCH] infiniband:core:Fix error handling in the function  cm_lap_handler "Hefty, Sean" <sean.hefty@intel.com> - 2015-09-18 18:20 +0200

#1228123 — RE: [PATCH] infiniband:core:Fix error handling in the function cm_lap_handler

From"Hefty, Sean" <sean.hefty@intel.com>
Date2015-09-18 18:20 +0200
SubjectRE: [PATCH] infiniband:core:Fix error handling in the function cm_lap_handler
Message-ID<qa6yd-7HP-9@gated-at.bofh.it>
> diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c
> index ea4db9c..8fab3a7 100644
> --- a/drivers/infiniband/core/cm.c
> +++ b/drivers/infiniband/core/cm.c
> @@ -2812,7 +2812,12 @@ static int cm_lap_handler(struct cm_work *work)
>  	cm_init_av_for_response(work->port, work->mad_recv_wc->wc,
>  				work->mad_recv_wc->recv_buf.grh,
>  				&cm_id_priv->av);
> -	cm_init_av_by_path(param->alternate_path, &cm_id_priv->alt_av);
> +	ret = cm_init_av_by_path(param->alternate_path, &cm_id_priv-
> >alt_av);
> +	if (ret) {
> +		spin_unlock_irq(&cm_id_priv->lock);
> +		cm_deref_id(cm_id_priv);
> +	}

How can this be right?  On a failure, we release the spinlock and the reference on the cm_id, then continue on with the processing?

> +
>  	ret = atomic_inc_and_test(&cm_id_priv->work_count);
>  	if (!ret)
>  		list_add_tail(&work->list, &cm_id_priv->work_list);
> --
> 2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web