Message ID | 20200605111859.7742-1-d.grigorev@omprussia.ru (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [BlueZ,v2] gobex: Fix segfault caused by interrupted transfer | expand |
This is automated email and please do not reply to this email! Dear submitter, Thank you for submitting the patches to the linux bluetooth mailing list. While we are preparing for reviewing the patches, we found the following issue/warning. Test Result: checkpatch Failed Outputs: WARNING:COMMIT_LOG_LONG_LINE: Possible unwrapped commit description (prefer a maximum 75 chars per line) #14: 0xecc6eeda in dbus_connection_get_object_path_data () from /usr/lib/libdbus-1.so.3 WARNING:UNKNOWN_COMMIT_ID: Unknown commit id '2baea85dec1a', maybe rebased or not pulled? #32: commit 2baea85dec1a ("Bluetooth: L2CAP ERTM shutdown protect sk and chan") WARNING:UNKNOWN_COMMIT_ID: Unknown commit id 'f65468f6e26c', maybe rebased or not pulled? #33: commit f65468f6e26c ("Bluetooth: Make __l2cap_wait_ack more efficient") WARNING:UNKNOWN_COMMIT_ID: Unknown commit id '451e4c6c6b3f', maybe rebased or not pulled? #34: commit 451e4c6c6b3f ("Bluetooth: Add BT_DBG to l2cap_sock_shutdown()") WARNING:UNKNOWN_COMMIT_ID: Unknown commit id 'cb02a25583b5', maybe rebased or not pulled? #35: commit cb02a25583b5 ("Bluetooth: __l2cap_wait_ack() use msecs_to_jiffies()") WARNING:UNKNOWN_COMMIT_ID: Unknown commit id 'e432c72c464d', maybe rebased or not pulled? #36: commit e432c72c464d ("Bluetooth: __l2cap_wait_ack() add defensive timeout") WARNING:UNKNOWN_COMMIT_ID: Unknown commit id 'e7456437c15a', maybe rebased or not pulled? #37: commit e7456437c15a ("Bluetooth: Unwind l2cap_sock_shutdown()") WARNING:UNKNOWN_COMMIT_ID: Unknown commit id '04ba72e6b24f', maybe rebased or not pulled? #38: commit 04ba72e6b24f ("Bluetooth: Reorganize mutex lock in l2cap_sock_shutdown()") WARNING:UNKNOWN_COMMIT_ID: Unknown commit id '9f7378a9d6ce', maybe rebased or not pulled? #39: commit 9f7378a9d6ce ("Bluetooth: l2cap_disconnection_req priority over shutdown") - total: 0 errors, 9 warnings, 34 lines checked NOTE: For some of the reported defects, checkpatch may be able to mechanically convert to the typical style using --fix or --fix-inplace. Your patch has style problems, please review. NOTE: Ignored message types: COMMIT_MESSAGE COMPLEX_MACRO CONST_STRUCT FILE_PATH_CHANGES MISSING_SIGN_OFF PREFER_PACKED SPLIT_STRING NOTE: If any of the errors are false positives, please report them to the maintainer, see CHECKPATCH in MAINTAINERS. --- Regards, Linux Bluetooth
This is automated email and please do not reply to this email! Dear submitter, Thank you for submitting the patches to the linux bluetooth mailing list. While we are preparing for reviewing the patches, we found the following issue/warning. Test Result: checkgitlint Failed Outputs: 11: B1 Line exceeds max length (82>80): "0xecc6eeda in dbus_connection_get_object_path_data () from /usr/lib/libdbus-1.so.3" 35: B1 Line exceeds max length (81>80): "commit 04ba72e6b24f ("Bluetooth: Reorganize mutex lock in l2cap_sock_shutdown()")" 36: B1 Line exceeds max length (81>80): "commit 9f7378a9d6ce ("Bluetooth: l2cap_disconnection_req priority over shutdown")" --- Regards, Linux Bluetooth
diff --git a/gobex/gobex-transfer.c b/gobex/gobex-transfer.c index bc9930679..e96e61fbc 100644 --- a/gobex/gobex-transfer.c +++ b/gobex/gobex-transfer.c @@ -100,6 +100,11 @@ static void transfer_complete(struct transfer *transfer, GError *err) g_obex_debug(G_OBEX_DEBUG_TRANSFER, "transfer %u", id); + if (err) { + /* No further tx must be performed */ + g_obex_drop_tx_queue(transfer->obex); + } + transfer->complete_func(transfer->obex, err, transfer->user_data); /* Check if the complete_func removed the transfer */ if (find_transfer(id) == NULL) diff --git a/gobex/gobex.c b/gobex/gobex.c index 77f1aaafd..d68a85eb6 100644 --- a/gobex/gobex.c +++ b/gobex/gobex.c @@ -521,6 +521,16 @@ static void enable_tx(GObex *obex) obex->write_source = g_io_add_watch(obex->io, cond, write_data, obex); } +void g_obex_drop_tx_queue(GObex *obex) +{ + struct pending_pkt *p; + + g_obex_debug(G_OBEX_DEBUG_COMMAND, ""); + + while ((p = g_queue_pop_head(obex->tx_queue))) + pending_pkt_free(p); +} + static gboolean g_obex_send_internal(GObex *obex, struct pending_pkt *p, GError **err) { diff --git a/gobex/gobex.h b/gobex/gobex.h index b223a2fac..a94d9246e 100644 --- a/gobex/gobex.h +++ b/gobex/gobex.h @@ -63,6 +63,7 @@ gboolean g_obex_remove_request_function(GObex *obex, guint id); void g_obex_suspend(GObex *obex); void g_obex_resume(GObex *obex); gboolean g_obex_srm_active(GObex *obex); +void g_obex_drop_tx_queue(GObex *obex); GObex *g_obex_new(GIOChannel *io, GObexTransportType transport_type, gssize rx_mtu, gssize tx_mtu);