mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-01-10 14:15:47 -05:00
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>
This commit is contained in:
committed by
Doug Ledford
parent
6c7d46fdb8
commit
44856be3e9
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user