]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
spi: offload: check offload ops existence before disabling the trigger
authorAndres Urian Florez <andres.emb.sys@gmail.com>
Sun, 8 Jun 2025 23:04:21 +0000 (18:04 -0500)
committerMark Brown <broonie@kernel.org>
Mon, 9 Jun 2025 12:31:50 +0000 (13:31 +0100)
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>
drivers/spi/spi-offload.c

index e674097bf3be307051c5b80a1c8666bd7f33a121..d336f4d228d5140e87ccd63ec307f89f9ac00c09 100644 (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;
                }