* [PATCH] CONNECTOR: don't touch queue dev after decrement of ref count
@ 2008-01-09 5:44 Li Zefan
2008-01-09 7:44 ` David Miller
2008-01-09 9:12 ` Evgeniy Polyakov
0 siblings, 2 replies; 3+ messages in thread
From: Li Zefan @ 2008-01-09 5:44 UTC (permalink / raw)
To: David Miller; +Cc: Evgeniy Polyakov, LKML
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>
---
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 23cc87a..5732ca3 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;
}
--
1.5.3.rc7
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] CONNECTOR: don't touch queue dev after decrement of ref count
2008-01-09 5:44 [PATCH] CONNECTOR: don't touch queue dev after decrement of ref count Li Zefan
@ 2008-01-09 7:44 ` David Miller
2008-01-09 9:12 ` Evgeniy Polyakov
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2008-01-09 7:44 UTC (permalink / raw)
To: lizf; +Cc: johnpol, linux-kernel
From: Li Zefan <lizf@cn.fujitsu.com>
Date: Wed, 09 Jan 2008 13:44:07 +0800
>
> 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>
Excellent catch, patch applied.
Thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] CONNECTOR: don't touch queue dev after decrement of ref count
2008-01-09 5:44 [PATCH] CONNECTOR: don't touch queue dev after decrement of ref count Li Zefan
2008-01-09 7:44 ` David Miller
@ 2008-01-09 9:12 ` Evgeniy Polyakov
1 sibling, 0 replies; 3+ messages in thread
From: Evgeniy Polyakov @ 2008-01-09 9:12 UTC (permalink / raw)
To: Li Zefan; +Cc: David Miller, LKML
On Wed, Jan 09, 2008 at 01:44:07PM +0800, Li Zefan (lizf@cn.fujitsu.com) wrote:
>
> 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>
Thanks a lot!
--
Evgeniy Polyakov
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-01-09 9:13 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-09 5:44 [PATCH] CONNECTOR: don't touch queue dev after decrement of ref count Li Zefan
2008-01-09 7:44 ` David Miller
2008-01-09 9:12 ` Evgeniy Polyakov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox