diff options
author | Mustafa Ismail <mustafa.ismail@intel.com> | 2016-08-22 19:15:58 -0400 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2016-08-23 12:40:20 -0400 |
commit | 44856be3e95c87f03e850ef4fdf8c0503c2dde18 (patch) | |
tree | 60bec147d6794293d87f95558903181818982088 | |
parent | 6c7d46fdb8165ece4b0a17fb8f0b9320dbfeffc2 (diff) |
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>
-rw-r--r-- | drivers/infiniband/hw/i40iw/i40iw.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/i40iw/i40iw.h b/drivers/infiniband/hw/i40iw/i40iw.h index 882f3ef2e4c7..8ec09e470f84 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, | |||
435 | *next = resource_num + 1; | 435 | *next = resource_num + 1; |
436 | if (*next == max_resources) | 436 | if (*next == max_resources) |
437 | *next = 0; | 437 | *next = 0; |
438 | spin_unlock_irqrestore(&iwdev->resource_lock, flags); | ||
439 | *req_resource_num = resource_num; | 438 | *req_resource_num = resource_num; |
439 | spin_unlock_irqrestore(&iwdev->resource_lock, flags); | ||
440 | 440 | ||
441 | return 0; | 441 | return 0; |
442 | } | 442 | } |