On 2017-02-14 14:32, Stanislaw Gruszka wrote:
> On Tue, Feb 14, 2017 at 02:10:01PM +0100, Felix Fietkau wrote:
>> On 2017-02-14 13:46, Stanislaw Gruszka wrote:
>> > Add station field to skb_frame_desc and assign it according to status
>> > WCID. This field will be used in the future.
>> > 
>> > Signed-off-by: Stanislaw Gruszka <[email protected]>
>> I see some potential for race conditions in this approach. You store the
>> sta pointer in struct skb_frame_desc, but I don't see anything that
>> guarantees that the sta will be around for as long as the tx frame is held.
>> I think a better approach would be to not store the sta pointer in
>> skb_frame_desc at all.
>> Instead, add a driver callback to look up the sta by wcid, and use rcu
>> properly there. Make sure you only hold the sta pointer obtained from
>> that call within a RCU read locked section.
> 
> On patch 7, where ->sta start to be used, I added RCU protection.
Maybe you should get rid of the skbdesc->sta assignment in patch 2,
because this is somewhat confusing.

- Felix

Reply via email to