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);