diff mbox

IB/rdmavt: restore IRQs on error path in rvt_create_ah()

Message ID 20170427091420.j7kl5tmzqnyami4s@mwanda (mailing list archive)
State Accepted
Headers show

Commit Message

Dan Carpenter April 27, 2017, 9:14 a.m. UTC
We need to call spin_unlock_irqrestore() instead of vanilla
spin_unlock() on this error path.

Fixes: 119a8e708d16 ("IB/rdmavt: Add AH to rdmavt")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

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

Comments

Leon Romanovsky April 27, 2017, 9:25 a.m. UTC | #1
On Thu, Apr 27, 2017 at 12:14:20PM +0300, Dan Carpenter wrote:
> We need to call spin_unlock_irqrestore() instead of vanilla
> spin_unlock() on this error path.
>
> Fixes: 119a8e708d16 ("IB/rdmavt: Add AH to rdmavt")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/drivers/infiniband/sw/rdmavt/ah.c b/drivers/infiniband/sw/rdmavt/ah.c
> index 16c446142c2a..b0f09fb45c72 100644
> --- a/drivers/infiniband/sw/rdmavt/ah.c
> +++ b/drivers/infiniband/sw/rdmavt/ah.c
> @@ -119,7 +119,7 @@ struct ib_ah *rvt_create_ah(struct ib_pd *pd,
>
>  	spin_lock_irqsave(&dev->n_ahs_lock, flags);
>  	if (dev->n_ahs_allocated == dev->dparms.props.max_ah) {
> -		spin_unlock(&dev->n_ahs_lock);
> +		spin_unlock_irqrestore(&dev->n_ahs_lock, flags);
>  		kfree(ah);
>  		return ERR_PTR(-ENOMEM);
>  	}

Thanks,
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
Dennis Dalessandro April 27, 2017, 5:14 p.m. UTC | #2
On 04/27/2017 05:14 AM, Dan Carpenter wrote:
> We need to call spin_unlock_irqrestore() instead of vanilla
> spin_unlock() on this error path.
>
> Fixes: 119a8e708d16 ("IB/rdmavt: Add AH to rdmavt")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Acked-by: Dennis Dalessandro <dennis.dalessandro@intel.com>


--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Doug Ledford April 28, 2017, 5:02 p.m. UTC | #3
On Thu, 2017-04-27 at 13:14 -0400, Dennis Dalessandro wrote:
> On 04/27/2017 05:14 AM, Dan Carpenter wrote:
> > 
> > We need to call spin_unlock_irqrestore() instead of vanilla
> > spin_unlock() on this error path.
> > 
> > Fixes: 119a8e708d16 ("IB/rdmavt: Add AH to rdmavt")
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> Acked-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
> 

Thanks, applied.
diff mbox

Patch

diff --git a/drivers/infiniband/sw/rdmavt/ah.c b/drivers/infiniband/sw/rdmavt/ah.c
index 16c446142c2a..b0f09fb45c72 100644
--- a/drivers/infiniband/sw/rdmavt/ah.c
+++ b/drivers/infiniband/sw/rdmavt/ah.c
@@ -119,7 +119,7 @@  struct ib_ah *rvt_create_ah(struct ib_pd *pd,
 
 	spin_lock_irqsave(&dev->n_ahs_lock, flags);
 	if (dev->n_ahs_allocated == dev->dparms.props.max_ah) {
-		spin_unlock(&dev->n_ahs_lock);
+		spin_unlock_irqrestore(&dev->n_ahs_lock, flags);
 		kfree(ah);
 		return ERR_PTR(-ENOMEM);
 	}