Commit 44856be3 authored by Mustafa Ismail's avatar Mustafa Ismail Committed by Doug Ledford

i40iw: Protect req_resource_num update

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

Fixes: 8e06af71 ("i40iw: add main, hdr, status")
Reported-by: default avatarStefan Assmann <sassmann@redhat.com>
Signed-off-by: default avatarMustafa Ismail <mustafa.ismail@intel.com>
Signed-off-by: default avatarShiraz Saleem <shiraz.saleem@intel.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent 6c7d46fd
...@@ -435,8 +435,8 @@ static inline int i40iw_alloc_resource(struct i40iw_device *iwdev, ...@@ -435,8 +435,8 @@ static inline int i40iw_alloc_resource(struct i40iw_device *iwdev,
*next = resource_num + 1; *next = resource_num + 1;
if (*next == max_resources) if (*next == max_resources)
*next = 0; *next = 0;
spin_unlock_irqrestore(&iwdev->resource_lock, flags);
*req_resource_num = resource_num; *req_resource_num = resource_num;
spin_unlock_irqrestore(&iwdev->resource_lock, flags);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment