summaryrefslogtreecommitdiffstats
path: root/drivers/connector/cn_queue.c
diff options
context:
space:
mode:
authorLi Zefan <lizf@cn.fujitsu.com>2008-01-09 08:44:44 +0100
committerDavid S. Miller <davem@davemloft.net>2008-01-09 08:44:44 +0100
commitcf585ae8ae9ac7287a6d078425ea32f22bf7f1f7 (patch)
tree6345d5ca0ae09d48ce130cdf4c11c47cf5f8489a /drivers/connector/cn_queue.c
parent[SOCK]: Adds a rcu_dereference() in sk_filter (diff)
downloadlinux-cf585ae8ae9ac7287a6d078425ea32f22bf7f1f7.tar.xz
linux-cf585ae8ae9ac7287a6d078425ea32f22bf7f1f7.zip
[CONNECTOR]: Don't touch queue dev after decrement of ref count.
cn_queue_free_callback() will touch 'dev'(i.e. cbq->pdev), so it should be called before atomic_dec(&dev->refcnt). Signed-off-by: Li Zefan <lizf@cn.fujitsu.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/connector/cn_queue.c')
-rw-r--r--drivers/connector/cn_queue.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/connector/cn_queue.c b/drivers/connector/cn_queue.c
index 296f51002b55..12ceed54ab18 100644
--- a/drivers/connector/cn_queue.c
+++ b/drivers/connector/cn_queue.c
@@ -99,8 +99,8 @@ int cn_queue_add_callback(struct cn_queue_dev *dev, char *name, struct cb_id *id
spin_unlock_bh(&dev->queue_lock);
if (found) {
- atomic_dec(&dev->refcnt);
cn_queue_free_callback(cbq);
+ atomic_dec(&dev->refcnt);
return -EINVAL;
}