From: Andres Urian Florez Date: Sun, 8 Jun 2025 23:04:21 +0000 (-0500) Subject: spi: offload: check offload ops existence before disabling the trigger X-Git-Tag: v6.16-rc2~12^2~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e51a086117ed857ea455c9ea774dbfb82f53e517;p=thirdparty%2Flinux.git 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 Link: https://patch.msgid.link/20250608230422.325360-1-andres.emb.sys@gmail.com Signed-off-by: Mark Brown --- diff --git a/drivers/spi/spi-offload.c b/drivers/spi/spi-offload.c index e674097bf3be..d336f4d228d5 100644 --- a/drivers/spi/spi-offload.c +++ b/drivers/spi/spi-offload.c @@ -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; }