From: Bernhard Messerklinger Date: Tue, 26 Mar 2019 09:01:24 +0000 (+0100) Subject: spi: spi-mem: Check if exec_op function is set before calling it X-Git-Tag: v2019.07-rc1~24^2~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=567a3eb7956f98af4ed065499898c6d0ac6443c7;p=platform%2Fkernel%2Fu-boot.git 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: Bernhard Messerklinger Reviewed-by: Bin Meng Reviewed-by: Jagan Teki --- diff --git a/drivers/spi/spi-mem.c b/drivers/spi/spi-mem.c index 1bb0987..b86eee7 100644 --- a/drivers/spi/spi-mem.c +++ b/drivers/spi/spi-mem.c @@ -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