[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <47845F27.6020305@cn.fujitsu.com>
Date: Wed, 09 Jan 2008 13:44:07 +0800
From: Li Zefan <lizf@...fujitsu.com>
To: David Miller <davem@...emloft.net>
CC: Evgeniy Polyakov <johnpol@....mipt.ru>,
LKML <linux-kernel@...r.kernel.org>
Subject: [PATCH] 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@...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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists