Hi Andre, > This patch adds the helper function cmd_failed() to handle mgmt > commands failures. This function sends the proper command status > event and removes the command from the pending list. > > Signed-off-by: Andre Guedes <andre.guedes@xxxxxxxxxxxxx> > --- > net/bluetooth/mgmt.c | 53 +++++++++++++++++-------------------------------- > 1 files changed, 19 insertions(+), 34 deletions(-) Acked-by: Marcel Holtmann <marcel@xxxxxxxxxxxx> <snip> > int mgmt_disconnect_failed(struct hci_dev *hdev) > { > - struct pending_cmd *cmd; > - int err; > - > - cmd = mgmt_pending_find(MGMT_OP_DISCONNECT, hdev); > - if (!cmd) > - return -ENOENT; > - > - err = cmd_status(cmd->sk, hdev->id, MGMT_OP_DISCONNECT, EIO); > - > - mgmt_pending_remove(cmd); > - > - return err; > + return cmd_failed(hdev, MGMT_OP_DISCONNECT, EIO); > } So the only left-over question now is if we need to keep these empty stub functions around or can just call cmd_failed directly. It might be actually cleaner to just call cmd_failed directly. Regards Marcel -- 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