Commit 567a3eb7 authored by Bernhard Messerklinger's avatar Bernhard Messerklinger Committed by Jagan Teki

spi: spi-mem: Check if exec_op function is set before calling it

Add check if exec_op is set before calling it.
At the moment it is called unconditionally, which leads to a crash if it
is not set correctly.
Signed-off-by: default avatarBernhard Messerklinger <bernhard.messerklinger@br-automation.com>
Reviewed-by: Bin Meng's avatarBin Meng <bmeng.cn@gmail.com>
Reviewed-by: Jagan Teki's avatarJagan Teki <jagan@amarulasolutions.com>
parent 3f3aef4b
......@@ -214,7 +214,7 @@ int spi_mem_exec_op(struct spi_slave *slave, const struct spi_mem_op *op)
if (ret < 0)
return ret;
if (ops->mem_ops) {
if (ops->mem_ops && ops->mem_ops->exec_op) {
#ifndef __UBOOT__
/*
* Flush the message queue before executing our SPI memory
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment