Hi Lukasz, On Mon, Mar 10, 2014, Lukasz Rymanowski wrote: > @@ -769,17 +772,22 @@ static bool inquiry_callback(void *user_data) > } > } > > - if (i == MAX_BTDEV_ENTRIES) { > - struct bt_hci_evt_inquiry_complete ic; > - > - ic.status = BT_HCI_ERR_SUCCESS; > - send_event(btdev, BT_HCI_EVT_INQUIRY_COMPLETE, &ic, sizeof(ic)); > + /* Check if we sent already required amount of responses*/ > + if (data->num_resp && data->sent_count == data->num_resp) > + goto finish; > > - btdev->inquiry_id = 0; > - return false; > - } > + if (i == MAX_BTDEV_ENTRIES) > + goto finish; > > return true; > + > +finish: > + /* Note that destroy will be called */ > + ic.status = BT_HCI_ERR_SUCCESS; > + send_event(btdev, BT_HCI_EVT_INQUIRY_COMPLETE, &ic, sizeof(ic)); > + > + btdev->inquiry_id = 0; > + return false; > } I know you're just moving it around from the first patch but isn't the btdev->inquiry_id = unnecessary here since you're doing the same in the destroy function which gets called as soon as you return false? 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