diff options
author | Li Zefan <lizf@cn.fujitsu.com> | 2008-01-11 01:11:48 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-02-06 11:43:44 -0800 |
commit | 149dc1d086f29d61ec15c748e0bbfc0aeca8b7d6 (patch) | |
tree | e21904c750580564f1182f3f128804ec9b4aa9b8 | |
parent | 1430c862581e5f666951315f5e7663b7d3d3d5d9 (diff) | |
download | lwn-149dc1d086f29d61ec15c748e0bbfc0aeca8b7d6.tar.gz lwn-149dc1d086f29d61ec15c748e0bbfc0aeca8b7d6.zip |
CONNECTOR: Don't touch queue dev after decrement of ref count.
[CONNECTOR]: Don't touch queue dev after decrement of ref count.
[ Upstream commit: cf585ae8ae9ac7287a6d078425ea32f22bf7f1f7 ]
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-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 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; } |