i40iw: Protect req_resource_num update

In i40iw_alloc_resource(), ensure that the update to
req_resource_num is protected by the lock.

Fixes: 8e06af711b ("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>
Šī revīzija ir iekļauta:
Mustafa Ismail
2016-08-22 18:15:58 -05:00
revīziju iesūtīja Doug Ledford
vecāks 6c7d46fdb8
revīzija 44856be3e9

Parādīt failu

@@ -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;
}