[patch 14/27] CONNECTOR: Dont touch queue dev after decrement of ref count.

2008-02-01 Thread Greg KH
2.6.22-stable review patch.  If anyone has any objections, please let us
know.

--
From: Li Zefan <[EMAIL PROTECTED]>

[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(>refcnt).

Signed-off-by: Li Zefan <[EMAIL PROTECTED]>
Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>

---
 drivers/connector/cn_queue.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/connector/cn_queue.c
+++ b/drivers/connector/cn_queue.c
@@ -99,8 +99,8 @@ int cn_queue_add_callback(struct cn_queu
spin_unlock_bh(>queue_lock);
 
if (found) {
-   atomic_dec(>refcnt);
cn_queue_free_callback(cbq);
+   atomic_dec(>refcnt);
return -EINVAL;
}
 

-- 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[patch 14/27] CONNECTOR: Dont touch queue dev after decrement of ref count.

2008-02-01 Thread Greg KH
2.6.22-stable review patch.  If anyone has any objections, please let us
know.

--
From: Li Zefan [EMAIL PROTECTED]

[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 [EMAIL PROTECTED]
Signed-off-by: David S. Miller [EMAIL PROTECTED]
Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED]

---
 drivers/connector/cn_queue.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/connector/cn_queue.c
+++ b/drivers/connector/cn_queue.c
@@ -99,8 +99,8 @@ int cn_queue_add_callback(struct cn_queu
spin_unlock_bh(dev-queue_lock);
 
if (found) {
-   atomic_dec(dev-refcnt);
cn_queue_free_callback(cbq);
+   atomic_dec(dev-refcnt);
return -EINVAL;
}
 

-- 
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/