summaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorMustafa Ismail <mustafa.ismail@intel.com>2016-08-22 18:15:58 -0500
committerDoug Ledford <dledford@redhat.com>2016-08-23 12:40:20 -0400
commit44856be3e95c87f03e850ef4fdf8c0503c2dde18 (patch)
tree60bec147d6794293d87f95558903181818982088 /drivers/infiniband
parent6c7d46fdb8165ece4b0a17fb8f0b9320dbfeffc2 (diff)
downloadop-kernel-dev-44856be3e95c87f03e850ef4fdf8c0503c2dde18.zip
op-kernel-dev-44856be3e95c87f03e850ef4fdf8c0503c2dde18.tar.gz
i40iw: Protect req_resource_num update
In i40iw_alloc_resource(), ensure that the update to req_resource_num is protected by the lock. Fixes: 8e06af711bf2 ("i40iw: add main, hdr, status") Reported-by: Stefan Assmann <sassmann@redhat.com> Signed-off-by: Mustafa Ismail <mustafa.ismail@intel.com> Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/hw/i40iw/i40iw.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/i40iw/i40iw.h b/drivers/infiniband/hw/i40iw/i40iw.h
index 882f3ef..8ec09e4 100644
--- a/drivers/infiniband/hw/i40iw/i40iw.h
+++ b/drivers/infiniband/hw/i40iw/i40iw.h
@@ -435,8 +435,8 @@ static inline int i40iw_alloc_resource(struct i40iw_device *iwdev,
*next = resource_num + 1;
if (*next == max_resources)
*next = 0;
- spin_unlock_irqrestore(&iwdev->resource_lock, flags);
*req_resource_num = resource_num;
+ spin_unlock_irqrestore(&iwdev->resource_lock, flags);
return 0;
}
OpenPOWER on IntegriCloud