Linux SPI subsystem development
 help / color / mirror / Atom feed
* [PATCH] spi: offload: check offload ops existence before disabling the trigger
@ 2025-06-08 23:04 Andres Urian Florez
  2025-06-09 13:46 ` David Lechner
  2025-06-09 15:40 ` Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Andres Urian Florez @ 2025-06-08 23:04 UTC (permalink / raw)
  To: dlechner, broonie; +Cc: Andres Urian Florez, skhan, linux-spi

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>
---
 drivers/spi/spi-offload.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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;
 		}
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-06-09 15:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-08 23:04 [PATCH] spi: offload: check offload ops existence before disabling the trigger Andres Urian Florez
2025-06-09 13:46 ` David Lechner
2025-06-09 15:40 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox