* [BUG][PATCH] bluetooth: put_device before device_del fix
@ 2007-12-27 5:27 Dave Young
2007-12-30 3:18 ` David Miller
0 siblings, 1 reply; 3+ messages in thread
From: Dave Young @ 2007-12-27 5:27 UTC (permalink / raw)
To: marcel; +Cc: akpm, greg, linux-kernel, bluez-devel
Because of workqueue delay, the put_device could be called before device_del, so move it to del_conn.
Signed-off-by: Dave Young <hidave.darkstar@gmail.com>
---
net/bluetooth/hci_conn.c | 10 +---------
net/bluetooth/hci_sysfs.c | 1 +
2 files changed, 2 insertions(+), 9 deletions(-)
diff -upr linux/net/bluetooth/hci_conn.c linux.new/net/bluetooth/hci_conn.c
--- linux/net/bluetooth/hci_conn.c 2007-12-27 13:12:48.000000000 +0800
+++ linux.new/net/bluetooth/hci_conn.c 2007-12-27 13:17:50.000000000 +0800
@@ -254,22 +254,14 @@ int hci_conn_del(struct hci_conn *conn)
}
tasklet_disable(&hdev->tx_task);
-
- hci_conn_del_sysfs(conn);
-
hci_conn_hash_del(hdev, conn);
if (hdev->notify)
hdev->notify(hdev, HCI_NOTIFY_CONN_DEL);
-
tasklet_enable(&hdev->tx_task);
-
skb_queue_purge(&conn->data_q);
-
+ hci_conn_del_sysfs(conn);
hci_dev_put(hdev);
- /* will free via device release */
- put_device(&conn->dev);
-
return 0;
}
diff -upr linux/net/bluetooth/hci_sysfs.c linux.new/net/bluetooth/hci_sysfs.c
--- linux/net/bluetooth/hci_sysfs.c 2007-12-27 13:12:48.000000000 +0800
+++ linux.new/net/bluetooth/hci_sysfs.c 2007-12-27 13:14:06.000000000 +0800
@@ -320,6 +320,7 @@ static void del_conn(struct work_struct
{
struct hci_conn *conn = container_of(work, struct hci_conn, work);
device_del(&conn->dev);
+ put_device(&conn->dev);
}
void hci_conn_del_sysfs(struct hci_conn *conn)
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [BUG][PATCH] bluetooth: put_device before device_del fix
2007-12-27 5:27 [BUG][PATCH] bluetooth: put_device before device_del fix Dave Young
@ 2007-12-30 3:18 ` David Miller
2008-01-02 1:00 ` Dave Young
0 siblings, 1 reply; 3+ messages in thread
From: David Miller @ 2007-12-30 3:18 UTC (permalink / raw)
To: hidave.darkstar; +Cc: marcel, akpm, greg, linux-kernel, bluez-devel
From: Dave Young <hidave.darkstar@gmail.com>
Date: Thu, 27 Dec 2007 13:27:50 +0800
> Because of workqueue delay, the put_device could be called before device_del, so move it to del_conn.
>
> Signed-off-by: Dave Young <hidave.darkstar@gmail.com>
Applied, thanks Dave.
Please post bluetooth patches, just like any other networking patches,
to netdev@vger.kernel.org (CC:'ing me) so that other networking
developers can process them during times like these when most
maintainers aren't around and thus not looking at bug fixes like
your's.
Thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [BUG][PATCH] bluetooth: put_device before device_del fix
2007-12-30 3:18 ` David Miller
@ 2008-01-02 1:00 ` Dave Young
0 siblings, 0 replies; 3+ messages in thread
From: Dave Young @ 2008-01-02 1:00 UTC (permalink / raw)
To: David Miller; +Cc: marcel, akpm, greg, linux-kernel, bluez-devel
On Dec 30, 2007 11:18 AM, David Miller <davem@davemloft.net> wrote:
> From: Dave Young <hidave.darkstar@gmail.com>
> Date: Thu, 27 Dec 2007 13:27:50 +0800
>
> > Because of workqueue delay, the put_device could be called before device_del, so move it to del_conn.
> >
> > Signed-off-by: Dave Young <hidave.darkstar@gmail.com>
>
> Applied, thanks Dave.
>
> Please post bluetooth patches, just like any other networking patches,
> to netdev@vger.kernel.org (CC:'ing me) so that other networking
> developers can process them during times like these when most
> maintainers aren't around and thus not looking at bug fixes like
> your's.
>
Ok, thanks for pointing out, I didn't know this before.
Regards
dave
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-01-02 1:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-27 5:27 [BUG][PATCH] bluetooth: put_device before device_del fix Dave Young
2007-12-30 3:18 ` David Miller
2008-01-02 1:00 ` Dave Young
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox