spi: offload: check offload ops existence before disabling the trigger

Add a safe guard in spi_offload_trigger to check the existence of
offload->ops before invoking the trigger_disable callback

Signed-off-by: Andres Urian Florez <andres.emb.sys@gmail.com>
Link: https://patch.msgid.link/20250608230422.325360-1-andres.emb.sys@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Andres Urian Florez 2025-06-08 18:04:21 -05:00 committed by Mark Brown
parent 2b74aea6d0
commit e51a086117
No known key found for this signature in database
GPG key ID: 24D68B725D5487D0

View file

@ -297,7 +297,7 @@ int spi_offload_trigger_enable(struct spi_offload *offload,
if (trigger->ops->enable) {
ret = trigger->ops->enable(trigger, config);
if (ret) {
if (offload->ops->trigger_disable)
if (offload->ops && offload->ops->trigger_disable)
offload->ops->trigger_disable(offload);
return ret;
}