Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH 0/4] Error handling in HCI request framework
@ 2013-03-06 23:45 Andre Guedes
  2013-03-06 23:45 ` [PATCH 1/4] Bluetooth: Check hci_req_run error code in __hci_req_sync Andre Guedes
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Andre Guedes @ 2013-03-06 23:45 UTC (permalink / raw)
  To: linux-bluetooth

Hi all,

This small patch set aims to add a better support for error handling in HCI
request framework.

When we are building a HCI request with more the one HCI command and one of
the hci_req_add calls fail, we should have some cleanup routine. This way the
HCI commands already queued on HCI request can be deleted. Otherwise we will
face some memory leaks issues. Discussing about this issue on IRC, we came up
with the approach implemented in this patch set.

The approach is the following: If a hci_req_add fails, we set a flag in struct
hci_request to indicate the failure. Subsequent hci_req_add calls will simply
add no HCI commands to the HCI request queue. Once hci_req_run is called, we
verify the error flag. If it is set, we delete all HCI commands already queued
and return a error code.

Regards,

Andre


Andre Guedes (4):
  Bluetooth: Check hci_req_run error code in __hci_req_sync
  Bluetooth: HCI request error handling
  Bluetooth: Make hci_req_add return void
  Bluetooth: Check req->error flag in hci_req_add

 include/net/bluetooth/hci_core.h |  5 ++++-
 net/bluetooth/hci_core.c         | 33 +++++++++++++++++++++++++++------
 2 files changed, 31 insertions(+), 7 deletions(-)

-- 
1.8.1.2


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2013-03-07 16:38 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-06 23:45 [PATCH 0/4] Error handling in HCI request framework Andre Guedes
2013-03-06 23:45 ` [PATCH 1/4] Bluetooth: Check hci_req_run error code in __hci_req_sync Andre Guedes
2013-03-07  7:11   ` Johan Hedberg
2013-03-07 16:37     ` Andre Guedes
2013-03-06 23:45 ` [PATCH 2/4] Bluetooth: HCI request error handling Andre Guedes
2013-03-07  7:15   ` Johan Hedberg
2013-03-07  7:19     ` Johan Hedberg
2013-03-07 16:38       ` Andre Guedes
2013-03-07 16:38     ` Andre Guedes
2013-03-06 23:45 ` [PATCH 3/4] Bluetooth: Make hci_req_add return void Andre Guedes
2013-03-06 23:45 ` [PATCH 4/4] Bluetooth: Check req->error flag in hci_req_add Andre Guedes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox