Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;
}