From 614c8a90b1ecf07f237032c48adcd670edaf32f9 Mon Sep 17 00:00:00 2001 From: Subbaraman Narayanamurthy Date: Fri, 4 Feb 2022 17:16:08 -0800 Subject: [PATCH] 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 --- drivers/input/misc/qcom-hv-haptics.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/input/misc/qcom-hv-haptics.c b/drivers/input/misc/qcom-hv-haptics.c index 05b9ab328b81..2c8d31ecf2f3 100644 --- a/drivers/input/misc/qcom-hv-haptics.c +++ b/drivers/input/misc/qcom-hv-haptics.c @@ -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);