diff options
author | Ying Xue <ying.xue@windriver.com> | 2015-05-04 10:36:46 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-05-04 15:04:01 -0400 |
commit | 00bc00a9384c306cdd48611a53b955d936349bf6 (patch) | |
tree | b6e9a41331a0fa5b401fd6c3727ed11bf065b0fc /kernel/printk | |
parent | 1b764828add9feaa18a8f916a79b954ac8a20a73 (diff) |
tipc: involve reference counter for subscriber
At present subscriber's lock is used to protect the subscription list
of subscriber as well as subscriptions linked into the list. While one
or all subscriptions are deleted through iterating the list, the
subscriber's lock must be held. Meanwhile, as deletion of subscription
may happen in subscription timer's handler, the lock must be grabbed
in the function as well. When subscription's timer is terminated with
del_timer_sync() during above iteration, subscriber's lock has to be
temporarily released, otherwise, deadlock may occur. However, the
temporary release may cause the double free of a subscription as the
subscription is not disconnected from the subscription list.
Now if a reference counter is introduced to subscriber, subscription's
timer can be asynchronously stopped with del_timer(). As a result, the
issue is not only able to be fixed, but also relevant code is pretty
readable and understandable.
Signed-off-by: Ying Xue <ying.xue@windriver.com>
Reviewed-by: Jon Maloy <jon.maloy@ericson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'kernel/printk')
0 files changed, 0 insertions, 0 deletions