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

Skip to content
Commit 021cc4ea authored by Lena Salman's avatar Lena Salman
Browse files

USB: u_bam_data: Optimize usage of spin_lock around skb_pool



Spin lock is dropped before allocating skbs from free pool
and acquired again by the skb pool alloc/free APIs. Same is
the case when skbs are added back to the pool. Around most
of these calls USB state is not checked when spin lock is
re-acquired. This opens up a race condition where USB
might be disconnected (resulting in freeing skb pool) just
before re-acquiring spin_lock resulting in use after free
or list corruption. Fix this by moving spin_lock handling
to the caller of skb pool alloc/free APIs.

Change-Id: I28bdfb46cce93b489b669dd3fddcc74488c2e130
Signed-off-by: default avatarLena Salman <esalman@codeaurora.org>
parent 13c60e82
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment