input: qcom-hv-haptics: Fix haptics_init_fifo_memory()

"fifo" is allocated per effect only when "qcom,wf-fifo-data" DT
property is specified. Fix haptics_init_fifo_memory() so that it
doesn't access that when parsing per effect data structure for
configuration.

Change-Id: I4f48e5c43c3b289e47d9a9a0934a642172e65555
Signed-off-by: Subbaraman Narayanamurthy <quic_subbaram@quicinc.com>
This commit is contained in:
Subbaraman Narayanamurthy 2022-02-04 17:16:08 -08:00 committed by David Collins
parent 44ec5b55d0
commit 614c8a90b1

View File

@ -2683,7 +2683,7 @@ static int haptics_init_fifo_memory(struct haptics_chip *chip)
for (i = 0; i < chip->effects_count; i++) {
effect = &chip->effects[i];
if (!effect->fifo->preload)
if (!effect->fifo || !effect->fifo->preload)
continue;
rc = haptics_mmap_preload_fifo_effect(chip, effect);
@ -2697,7 +2697,7 @@ static int haptics_init_fifo_memory(struct haptics_chip *chip)
for (i = 0; i < chip->effects_count; i++) {
effect = &chip->effects[i];
if (!effect->fifo->preload)
if (!effect->fifo || !effect->fifo->preload)
continue;
rc = haptics_config_preload_fifo_effect(chip, effect);