mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-12-27 10:01:39 -05:00
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:
committed by
Mark Brown
parent
2b74aea6d0
commit
e51a086117
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user