Message ID | 20231229012953.1969874-1-xiaokeqinhealth@126.com |
---|---|
State | New |
Headers | show |
Series | [BlueZ,v2,1/1] avdtp: fix incorrect transaction label in setconf phase | 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. This is a CI test results with your patch series: PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=813281 ---Test result--- Test Summary: CheckPatch FAIL 0.62 seconds GitLint FAIL 0.48 seconds BuildEll PASS 24.65 seconds BluezMake PASS 761.31 seconds MakeCheck PASS 12.12 seconds MakeDistcheck PASS 167.85 seconds CheckValgrind PASS 227.09 seconds CheckSmatch PASS 329.57 seconds bluezmakeextell PASS 106.47 seconds IncrementalBuild PASS 713.01 seconds ScanBuild WARNING 974.10 seconds Details ############################## Test: CheckPatch - FAIL Desc: Run checkpatch.pl script Output: [BlueZ,v2,1/1] avdtp: fix incorrect transaction label in setconf phase WARNING:COMMIT_LOG_LONG_LINE: Possible unwrapped commit description (prefer a maximum 75 chars per line) #68: AVDTP: Get All Capabilities (0x0c) Response Accept (0x02) type 0x00 label 6 nosp 0 /github/workspace/src/src/13506254.patch total: 0 errors, 1 warnings, 37 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. /github/workspace/src/src/13506254.patch has style problems, please review. NOTE: Ignored message types: COMMIT_MESSAGE COMPLEX_MACRO CONST_STRUCT FILE_PATH_CHANGES MISSING_SIGN_OFF PREFER_PACKED SPDX_LICENSE_TAG SPLIT_STRING SSCANF_TO_KSTRTO NOTE: If any of the errors are false positives, please report them to the maintainer, see CHECKPATCH in MAINTAINERS. ############################## Test: GitLint - FAIL Desc: Run gitlint Output: [BlueZ,v2,1/1] avdtp: fix incorrect transaction label in setconf phase WARNING: I3 - ignore-body-lines: gitlint will be switching from using Python regex 'match' (match beginning) to 'search' (match anywhere) semantics. Please review your ignore-body-lines.regex option accordingly. To remove this warning, set general.regex-style-search=True. More details: https://jorisroovers.github.io/gitlint/configuration/#regex-style-search 23: B1 Line exceeds max length (82>80): "AVDTP: Get All Capabilities (0x0c) Response Accept (0x02) type 0x00 label 6 nosp 0" 25: B1 Line exceeds max length (82>80): "AVDTP: Get All Capabilities (0x0c) Response Accept (0x02) type 0x00 label 7 nosp 0" 35: B3 Line contains hard tab characters (\t): " MEDIA_ENDPOINT_INTERFACE," 36: B3 Line contains hard tab characters (\t): " "SetConfiguration");" 37: B3 Line contains hard tab characters (\t): " media_endpoint_async_call()" 38: B3 Line contains hard tab characters (\t): " //dbus send" 39: B3 Line contains hard tab characters (\t): " g_dbus_send_message_with_reply(btd_get_dbus_connection()," 40: B3 Line contains hard tab characters (\t): " msg, &request->call," 41: B3 Line contains hard tab characters (\t): " REQUEST_TIMEOUT(3 seconds))" 42: B3 Line contains hard tab characters (\t): " dbus_pending_call_set_notify(request->call, endpoint_reply, request,NULL);" 43: B3 Line contains hard tab characters (\t): " ..." 51: B1 Line exceeds max length (81>80): "> AVDTP: Set Configuration (0x03) Response Accept (0x02) type 0x00 label 0 nosp 0" 56: B3 Line contains hard tab characters (\t): " //the sender to discard the message. (The correct transaction" 57: B3 Line contains hard tab characters (\t): " //value is 8)" 59: B3 Line contains hard tab characters (\t): " AVDTP_SET_CONFIGURATION, NULL, 0)" 64: B1 Line exceeds max length (82>80): "AVDTP: Get All Capabilities (0x0c) Response Accept (0x02) type 0x00 label 2 nosp 0" ############################## Test: ScanBuild - WARNING Desc: Run Scan Build Output: profiles/audio/avdtp.c:896:25: warning: Use of memory after it is freed session->prio_queue = g_slist_remove(session->prio_queue, req); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ profiles/audio/avdtp.c:903:24: warning: Use of memory after it is freed session->req_queue = g_slist_remove(session->req_queue, req); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2 warnings generated. --- Regards, Linux Bluetooth
diff --git a/profiles/audio/avdtp.c b/profiles/audio/avdtp.c index 10ef380d4..edbb1f94a 100644 --- a/profiles/audio/avdtp.c +++ b/profiles/audio/avdtp.c @@ -286,6 +286,7 @@ struct in_buf { gboolean active; int no_of_packets; uint8_t transaction; + uint8_t async_transaction; uint8_t message_type; uint8_t signal_id; uint8_t buf[1024]; @@ -1462,15 +1463,16 @@ static void setconf_cb(struct avdtp *session, struct avdtp_stream *stream, if (err != NULL) { rej.error = AVDTP_UNSUPPORTED_CONFIGURATION; rej.category = err->err.error_code; - avdtp_send(session, session->in.transaction, + avdtp_send(session, session->in.async_transaction, AVDTP_MSG_TYPE_REJECT, AVDTP_SET_CONFIGURATION, &rej, sizeof(rej)); stream_free(stream); return; } - if (!avdtp_send(session, session->in.transaction, AVDTP_MSG_TYPE_ACCEPT, - AVDTP_SET_CONFIGURATION, NULL, 0)) { + if (!avdtp_send(session, session->in.async_transaction, + AVDTP_MSG_TYPE_ACCEPT, + AVDTP_SET_CONFIGURATION, NULL, 0)) { stream_free(stream); return; } @@ -1569,6 +1571,11 @@ static gboolean avdtp_setconf_cmd(struct avdtp *session, uint8_t transaction, session->version = 0x0103; if (sep->ind && sep->ind->set_configuration) { + /* The set configuration stage is the only asynchronous, + * thus it is necessary to record the transaction label + * for direct use in accept msg. + */ + session->in.async_transaction = transaction; if (!sep->ind->set_configuration(session, sep, stream, stream->caps, setconf_cb,