Re: [PATCH 1/7] Bluetooth: Add automated SSP user confirmation responses

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Lizardo,

On Wed, Apr 27, 2011, Anderson Lizardo wrote:
> On Wed, Apr 27, 2011 at 7:04 PM,  <johan.hedberg@xxxxxxxxx> wrote:
> > @@ -2447,14 +2447,47 @@ static inline void hci_user_confirm_request_evt(struct hci_dev *hdev,
> >                                                        struct sk_buff *skb)
> >  {
> >        struct hci_ev_user_confirm_req *ev = (void *) skb->data;
> > +       int loc_mitm, rem_mitm;
> > +       struct hci_conn *conn;
> >
> >        BT_DBG("%s", hdev->name);
> >
> >        hci_dev_lock(hdev);
> >
> > -       if (test_bit(HCI_MGMT, &hdev->flags))
> > -               mgmt_user_confirm_request(hdev->id, &ev->bdaddr, ev->passkey);
> > +       if (!test_bit(HCI_MGMT, &hdev->flags))
> > +               goto unlock;
> 
> You lock hdev for checking hdev->flags, but not for reading hdev->name
> on the BT_DBG() call. Is that ok?

I suppose hdev->name can be considered a read-only value as it never
changes after the HCI dev is created. There's also lots of other places
in hci_event.c that access it without locking, so I think this should be
fine.

Johan
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux