From 8959c7de20192e53fca3cf16b0c3b5646ec7e3e0 Mon Sep 17 00:00:00 2001 From: wangmengyang Date: Mon, 3 Jul 2017 17:25:44 +0800 Subject: [PATCH] component/bt: bugfix for AVDTP state machine during disconnection in failure to handle NULL parameter --- components/bt/bluedroid/stack/avdt/avdt_scb_act.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/components/bt/bluedroid/stack/avdt/avdt_scb_act.c b/components/bt/bluedroid/stack/avdt/avdt_scb_act.c index ec270d268..d645f32d1 100644 --- a/components/bt/bluedroid/stack/avdt/avdt_scb_act.c +++ b/components/bt/bluedroid/stack/avdt/avdt_scb_act.c @@ -956,7 +956,11 @@ void avdt_scb_hdl_tc_close(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data) /* set up hdr */ avdt_ctrl.hdr.err_code = p_scb->close_code; - avdt_ctrl.hdr.err_param = p_data->close.disc_rsn; + if (p_data) { + avdt_ctrl.hdr.err_param = p_data->close.disc_rsn; + } else { + avdt_ctrl.hdr.err_param = AVDT_DISC_RSN_NORMAL; + } /* clear sep variables */ avdt_scb_clr_vars(p_scb, p_data);