diff --git a/techpack/audio/asoc/codecs/sdm660_cdc/msm-digital-cdc.c b/techpack/audio/asoc/codecs/sdm660_cdc/msm-digital-cdc.c index 11dce64e6f13..437b0ba0c3eb 100644 --- a/techpack/audio/asoc/codecs/sdm660_cdc/msm-digital-cdc.c +++ b/techpack/audio/asoc/codecs/sdm660_cdc/msm-digital-cdc.c @@ -1,6 +1,7 @@ // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2015-2017, 2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved. */ #include #include @@ -1141,8 +1142,10 @@ static int msm_dig_cdc_event_notify(struct notifier_block *block, break; case DIG_CDC_EVENT_SSR_UP: regcache_cache_only(msm_dig_cdc->regmap, false); - regcache_mark_dirty(msm_dig_cdc->regmap); - + if ((msm_dig_cdc->regmap) != NULL && (msm_dig_cdc->regmap->lock) != NULL && + (msm_dig_cdc->regmap->lock_arg) != NULL) { + regcache_mark_dirty(msm_dig_cdc->regmap); + } mutex_lock(&pdata->cdc_int_mclk0_mutex); pdata->digital_cdc_core_clk.enable = 1; ret = afe_set_lpass_clock_v2( @@ -1156,7 +1159,10 @@ static int msm_dig_cdc_event_notify(struct notifier_block *block, } mutex_unlock(&pdata->cdc_int_mclk0_mutex); - regcache_sync(msm_dig_cdc->regmap); + if ((msm_dig_cdc->regmap) != NULL && (msm_dig_cdc->regmap->lock) != NULL && + (msm_dig_cdc->regmap->lock_arg) != NULL) { + regcache_sync(msm_dig_cdc->regmap); + } mutex_lock(&pdata->cdc_int_mclk0_mutex); pdata->digital_cdc_core_clk.enable = 0; diff --git a/techpack/audio/dsp/q6lsm.c b/techpack/audio/dsp/q6lsm.c index b693dca5ad2c..a5f987738366 100644 --- a/techpack/audio/dsp/q6lsm.c +++ b/techpack/audio/dsp/q6lsm.c @@ -2035,8 +2035,18 @@ static int q6lsm_mmapcallback(struct apr_client_data *data, void *priv) lsm_common.set_custom_topology = 1; return 0; } + + /* + The payload_size can be either 4 or 8 bytes. + It has to be verified whether the payload_size is + atleast 4 bytes. If it is less, returns errorcode. - if (data->payload_size < (2 * sizeof(uint32_t))) { + The opcode for 4 bytes is 0x12A80 + The opcode for 8 bytes is 0x110E8. + + */ + + if (data->payload_size < (2 * sizeof(uint16_t))) { pr_err("%s: payload has invalid size[%d]\n", __func__, data->payload_size); return -EINVAL;