Skip to content

Commit 27c245a

Browse files
lylezhu2012cfriedt
authored andcommitted
Bluetooth: Classic: RFCOMM: Fix NULL pointer access issue
When received the DLC disconnect request, after prime the DLC disconnect response, the DLC will be cleared and the `dlc->session` is cleared. If the no DLC is linked in current session, the idle timer of the session will be scheduled. In current implementation, the `dlc->session` is used to get the session pointer, but it is invalid in this time. And the unexpected fault occurs. Fix the issue by getting the session pointer from parameter of the function `rfcomm_handle_disc()` instead of `dlc->session`. Fix issue #99035. Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
1 parent b38054b commit 27c245a

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

subsys/bluetooth/host/classic/rfcomm.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1375,8 +1375,7 @@ static void rfcomm_handle_disc(struct bt_rfcomm_session *session, uint8_t dlci)
13751375

13761376
if (!session->dlcs) {
13771377
/* Start a session idle timer */
1378-
k_work_reschedule(&dlc->session->rtx_work,
1379-
RFCOMM_IDLE_TIMEOUT);
1378+
k_work_reschedule(&session->rtx_work, RFCOMM_IDLE_TIMEOUT);
13801379
}
13811380
} else {
13821381
/* Cancel idle timer */

0 commit comments

Comments
 (0)