diff for duplicates of <20120309144804.GF4497@localhost> diff --git a/a/1.txt b/N1/1.txt index a32d238..3e350ff 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -1,7 +1,7 @@ Hi David, On Fri, Mar 09, 2012 at 03:04:11PM +0100, David Herrmann wrote: -> On Fri, Mar 9, 2012 at 1:53 PM, Johan Hovold <jhovold@gmail.com> wrote: +> On Fri, Mar 9, 2012 at 1:53 PM, Johan Hovold <jhovold-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > Make sure hci_dev_open returns immediately if hci_dev_unregister has > > been called. > > diff --git a/a/content_digest b/N1/content_digest index e786b0e..1bce0cb 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -1,23 +1,24 @@ "ref\01331228606.14217.5.camel@aeonflux\0" "ref\01331297594-13332-1-git-send-email-jhovold@gmail.com\0" "ref\0CANq1E4Rt0ctZ5cpXipJE--YmkR4OjKBXLBQkeTKWP3+Q-q37Yw@mail.gmail.com\0" - "From\0Johan Hovold <jhovold@gmail.com>\0" + "ref\0CANq1E4Rt0ctZ5cpXipJE--YmkR4OjKBXLBQkeTKWP3+Q-q37Yw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org\0" + "From\0Johan Hovold <jhovold-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>\0" "Subject\0Re: [PATCH 2/2 v2] bluetooth: hci_core: fix NULL-pointer dereference at unregister\0" "Date\0Fri, 9 Mar 2012 15:48:04 +0100\0" - "To\0David Herrmann <dh.herrmann@googlemail.com>\0" - "Cc\0Marcel Holtmann <marcel@holtmann.org>" - Gustavo F. Padovan <padovan@profusion.mobi> - David S. Miller <davem@davemloft.net> - linux-bluetooth@vger.kernel.org - linux-kernel@vger.kernel.org - netdev@vger.kernel.org - " stable <stable@vger.kernel.org>\0" + "To\0David Herrmann <dh.herrmann-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>\0" + "Cc\0Marcel Holtmann <marcel-kz+m5ild9QBg9hUCZPvPmw@public.gmane.org>" + Gustavo F. Padovan <padovan-Y3ZbgMPKUGA34EUeqzHoZw@public.gmane.org> + David S. Miller <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org> + linux-bluetooth-u79uwXL29TY76Z2rM5mHXA@public.gmane.org + linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org + netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org + " stable <stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>\0" "\00:1\0" "b\0" "Hi David,\n" "\n" "On Fri, Mar 09, 2012 at 03:04:11PM +0100, David Herrmann wrote:\n" - "> On Fri, Mar 9, 2012 at 1:53 PM, Johan Hovold <jhovold@gmail.com> wrote:\n" + "> On Fri, Mar 9, 2012 at 1:53 PM, Johan Hovold <jhovold-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:\n" "> > Make sure hci_dev_open returns immediately if hci_dev_unregister has\n" "> > been called.\n" "> >\n" @@ -84,4 +85,4 @@ "Thanks,\n" Johan -21838dc4acee87a84e627c6f66b254f00cad39559278fdb37919da3d5b7a81d1 +0b14c9233bbcaee9edbeb6e57194aeace1e723edd588d92ec4414c1281b5a2d3
diff --git a/a/1.txt b/N2/1.txt index a32d238..a790807 100644 --- a/a/1.txt +++ b/N2/1.txt @@ -14,10 +14,10 @@ On Fri, Mar 09, 2012 at 03:04:11PM +0100, David Herrmann wrote: > > > > 1. hci_dev_open called from hci_power_on grabs req lock > > 2. hci_init_req executes but device fails to initialise (times out -> > eventually) +> > � eventually) > > 3. hci_dev_open is called from hci_sock_ioctl and sleeps on req lock > > 4. hci_uart_tty_close calls hci_dev_unregister and sleeps on req lock in -> > hci_dev_do_close +> > � hci_dev_do_close > > 5. hci_dev_open (1) releases req lock > > 6. hci_dev_do_close grabs req lock and returns as device is not up > > 7. hci_dev_unregister sleeps in destroy_workqueue @@ -31,13 +31,13 @@ On Fri, Mar 09, 2012 at 03:04:11PM +0100, David Herrmann wrote: > > --- a/include/net/bluetooth/hci.h > > +++ b/include/net/bluetooth/hci.h > > @@ -93,6 +93,8 @@ enum { -> > * states from the controller. -> > */ -> > enum { -> > + HCI_UNREGISTER, +> > �* states from the controller. +> > �*/ +> > �enum { +> > + � � � HCI_UNREGISTER, > > + -> > HCI_LE_SCAN, -> > }; +> > � � � �HCI_LE_SCAN, +> > �}; > > > > diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c > > index d6448f0..22b6781 100644 @@ -45,12 +45,12 @@ On Fri, Mar 09, 2012 at 03:04:11PM +0100, David Herrmann wrote: > > +++ b/net/bluetooth/hci_core.c > > @@ -525,6 +525,11 @@ int hci_dev_open(__u16 dev) > > -> > hci_req_lock(hdev); +> > � � � �hci_req_lock(hdev); > > -> > + if (test_bit(HCI_UNREGISTER, &hdev->dev_flags)) { -> > + ret = -ENODEV; -> > + goto done; -> > + } +> > + � � � if (test_bit(HCI_UNREGISTER, &hdev->dev_flags)) { +> > + � � � � � � � ret = -ENODEV; +> > + � � � � � � � goto done; +> > + � � � } > > + > > Isn't it enough to check for HCI_RUNNING here? We obviously have a diff --git a/a/content_digest b/N2/content_digest index e786b0e..88bc8c0 100644 --- a/a/content_digest +++ b/N2/content_digest @@ -30,10 +30,10 @@ "> >\n" "> > 1. hci_dev_open called from hci_power_on grabs req lock\n" "> > 2. hci_init_req executes but device fails to initialise (times out\n" - "> > \302\240 eventually)\n" + "> > \303\257\302\277\302\275 eventually)\n" "> > 3. hci_dev_open is called from hci_sock_ioctl and sleeps on req lock\n" "> > 4. hci_uart_tty_close calls hci_dev_unregister and sleeps on req lock in\n" - "> > \302\240 hci_dev_do_close\n" + "> > \303\257\302\277\302\275 hci_dev_do_close\n" "> > 5. hci_dev_open (1) releases req lock\n" "> > 6. hci_dev_do_close grabs req lock and returns as device is not up\n" "> > 7. hci_dev_unregister sleeps in destroy_workqueue\n" @@ -47,13 +47,13 @@ "> > --- a/include/net/bluetooth/hci.h\n" "> > +++ b/include/net/bluetooth/hci.h\n" "> > @@ -93,6 +93,8 @@ enum {\n" - "> > \302\240* states from the controller.\n" - "> > \302\240*/\n" - "> > \302\240enum {\n" - "> > + \302\240 \302\240 \302\240 HCI_UNREGISTER,\n" + "> > \303\257\302\277\302\275* states from the controller.\n" + "> > \303\257\302\277\302\275*/\n" + "> > \303\257\302\277\302\275enum {\n" + "> > + \303\257\302\277\302\275 \303\257\302\277\302\275 \303\257\302\277\302\275 HCI_UNREGISTER,\n" "> > +\n" - "> > \302\240 \302\240 \302\240 \302\240HCI_LE_SCAN,\n" - "> > \302\240};\n" + "> > \303\257\302\277\302\275 \303\257\302\277\302\275 \303\257\302\277\302\275 \303\257\302\277\302\275HCI_LE_SCAN,\n" + "> > \303\257\302\277\302\275};\n" "> >\n" "> > diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c\n" "> > index d6448f0..22b6781 100644\n" @@ -61,12 +61,12 @@ "> > +++ b/net/bluetooth/hci_core.c\n" "> > @@ -525,6 +525,11 @@ int hci_dev_open(__u16 dev)\n" "> >\n" - "> > \302\240 \302\240 \302\240 \302\240hci_req_lock(hdev);\n" + "> > \303\257\302\277\302\275 \303\257\302\277\302\275 \303\257\302\277\302\275 \303\257\302\277\302\275hci_req_lock(hdev);\n" "> >\n" - "> > + \302\240 \302\240 \302\240 if (test_bit(HCI_UNREGISTER, &hdev->dev_flags)) {\n" - "> > + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 ret = -ENODEV;\n" - "> > + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 goto done;\n" - "> > + \302\240 \302\240 \302\240 }\n" + "> > + \303\257\302\277\302\275 \303\257\302\277\302\275 \303\257\302\277\302\275 if (test_bit(HCI_UNREGISTER, &hdev->dev_flags)) {\n" + "> > + \303\257\302\277\302\275 \303\257\302\277\302\275 \303\257\302\277\302\275 \303\257\302\277\302\275 \303\257\302\277\302\275 \303\257\302\277\302\275 \303\257\302\277\302\275 ret = -ENODEV;\n" + "> > + \303\257\302\277\302\275 \303\257\302\277\302\275 \303\257\302\277\302\275 \303\257\302\277\302\275 \303\257\302\277\302\275 \303\257\302\277\302\275 \303\257\302\277\302\275 goto done;\n" + "> > + \303\257\302\277\302\275 \303\257\302\277\302\275 \303\257\302\277\302\275 }\n" "> > +\n" "> \n" "> Isn't it enough to check for HCI_RUNNING here? We obviously have a\n" @@ -84,4 +84,4 @@ "Thanks,\n" Johan -21838dc4acee87a84e627c6f66b254f00cad39559278fdb37919da3d5b7a81d1 +457ac1a7feb6b4e693fbb1f61b3909c82f82b7da27865ed7a372de221ea2fa54
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.