diff options
author | Li Zefan <lizf@cn.fujitsu.com> | 2008-01-16 01:18:12 +0200 |
---|---|---|
committer | Adrian Bunk <bunk@kernel.org> | 2008-01-16 01:18:12 +0200 |
commit | f9fdf12742cdc18ca30ff6c3bec3bf1748deffa7 (patch) | |
tree | affa007cc2d66bf7b2e9b100f651d28ddef993f6 /drivers | |
parent | 2f248cf37ebe3cf9892905a5356f6f031751a477 (diff) |
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: Adrian Bunk <bunk@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/connector/cn_queue.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/connector/cn_queue.c b/drivers/connector/cn_queue.c index 9f2f00d8291..e9de8a79aca 100644 --- a/drivers/connector/cn_queue.c +++ b/drivers/connector/cn_queue.c @@ -98,8 +98,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; } |