diff mbox

IB/hfi1: Add a missing rcu_read_unlock()

Message ID 20180305175833.7271-1-bart.vanassche@wdc.com (mailing list archive)
State Accepted
Delegated to: Jason Gunthorpe
Headers show

Commit Message

Bart Van Assche March 5, 2018, 5:58 p.m. UTC
This patch avoids that sparse reports the following:

drivers/infiniband/hw/hfi1/driver.c:251:13: warning: context imbalance in 'rcv_hdrerr' - different lock contexts for basic block

Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Cc: Mike Marciniszyn <mike.marciniszyn@intel.com>
Cc: Dennis Dalessandro <dennis.dalessandro@intel.com>
---
 drivers/infiniband/hw/hfi1/driver.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Jason Gunthorpe March 6, 2018, 11:35 p.m. UTC | #1
On Mon, Mar 05, 2018 at 09:58:33AM -0800, Bart Van Assche wrote:
> This patch avoids that sparse reports the following:
> 
> drivers/infiniband/hw/hfi1/driver.c:251:13: warning: context imbalance in 'rcv_hdrerr' - different lock contexts for basic block
> 
> Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
> Cc: Mike Marciniszyn <mike.marciniszyn@intel.com>
> Cc: Dennis Dalessandro <dennis.dalessandro@intel.com>
>  drivers/infiniband/hw/hfi1/driver.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/infiniband/hw/hfi1/driver.c b/drivers/infiniband/hw/hfi1/driver.c
> index addc68e83606..46d1475b2154 100644
> +++ b/drivers/infiniband/hw/hfi1/driver.c
> @@ -390,6 +390,7 @@ static void rcv_hdrerr(struct hfi1_ctxtdata *rcd, struct hfi1_pportdata *ppd,
>  				svc_type = IB_CC_SVCTYPE_UC;
>  				break;
>  			default:
> +				rcu_read_unlock();
>  				goto drop;
>  			}

Yep, sure looks obviously right, applied to for-next

Jason
--
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
Dennis Dalessandro March 7, 2018, 3:05 p.m. UTC | #2
On 3/6/2018 6:35 PM, Jason Gunthorpe wrote:
> On Mon, Mar 05, 2018 at 09:58:33AM -0800, Bart Van Assche wrote:
>> This patch avoids that sparse reports the following:
>>
>> drivers/infiniband/hw/hfi1/driver.c:251:13: warning: context imbalance in 'rcv_hdrerr' - different lock contexts for basic block
>>
>> Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
>> Cc: Mike Marciniszyn <mike.marciniszyn@intel.com>
>> Cc: Dennis Dalessandro <dennis.dalessandro@intel.com>
>>   drivers/infiniband/hw/hfi1/driver.c | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/infiniband/hw/hfi1/driver.c b/drivers/infiniband/hw/hfi1/driver.c
>> index addc68e83606..46d1475b2154 100644
>> +++ b/drivers/infiniband/hw/hfi1/driver.c
>> @@ -390,6 +390,7 @@ static void rcv_hdrerr(struct hfi1_ctxtdata *rcd, struct hfi1_pportdata *ppd,
>>   				svc_type = IB_CC_SVCTYPE_UC;
>>   				break;
>>   			default:
>> +				rcu_read_unlock();
>>   				goto drop;
>>   			}
> 
> Yep, sure looks obviously right, applied to for-next
> 

Sorry I meant to Ack this. Discussed internally with Mike and we are 
good with it.

This is technically an unreachable code path on current HW. We do plan 
to rip out all of the A0 stuff, but in the meantime this is a correct 
patch and will quiet sparse so thanks Bart!


-Denny
--
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
diff mbox

Patch

diff --git a/drivers/infiniband/hw/hfi1/driver.c b/drivers/infiniband/hw/hfi1/driver.c
index addc68e83606..46d1475b2154 100644
--- a/drivers/infiniband/hw/hfi1/driver.c
+++ b/drivers/infiniband/hw/hfi1/driver.c
@@ -390,6 +390,7 @@  static void rcv_hdrerr(struct hfi1_ctxtdata *rcd, struct hfi1_pportdata *ppd,
 				svc_type = IB_CC_SVCTYPE_UC;
 				break;
 			default:
+				rcu_read_unlock();
 				goto drop;
 			}