Merge "asoc: codecs: Add NULL check before calling bcs_enable callback function"

This commit is contained in:
qctecmdr
2019-11-20 06:45:37 -08:00
committed by Gerrit - the friendly Code Review server

View File

@@ -694,6 +694,7 @@ correct_plug_type:
*/
if (plug_type == MBHC_PLUG_TYPE_HEADSET ||
plug_type == MBHC_PLUG_TYPE_HEADPHONE)
if (mbhc->mbhc_cb->bcs_enable)
mbhc->mbhc_cb->bcs_enable(mbhc, false);
timeout = jiffies + msecs_to_jiffies(HS_DETECT_PLUG_TIME_MS);
@@ -842,6 +843,7 @@ correct_plug_type:
}
if ((plug_type == MBHC_PLUG_TYPE_HEADSET ||
plug_type == MBHC_PLUG_TYPE_HEADPHONE))
if (mbhc->mbhc_cb->bcs_enable)
mbhc->mbhc_cb->bcs_enable(mbhc, true);
if (!wrk_complete) {