From b21e05c9cf943d427007d026b199575d6a172acb Mon Sep 17 00:00:00 2001 From: Rasesh Mody Date: Fri, 6 Oct 2017 23:31:00 -0700 Subject: [PATCH] net/qede/base: add check for DMA engine state Check DMA engine state to verify it is not called before it is initialized Signed-off-by: Rasesh Mody --- drivers/net/qede/base/ecore_hw.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/net/qede/base/ecore_hw.c b/drivers/net/qede/base/ecore_hw.c index d6217d8b68..bc0138f612 100644 --- a/drivers/net/qede/base/ecore_hw.c +++ b/drivers/net/qede/base/ecore_hw.c @@ -789,6 +789,15 @@ ecore_dmae_execute_command(struct ecore_hwfn *p_hwfn, return ECORE_SUCCESS; } + if (!cmd) { + DP_NOTICE(p_hwfn, true, + "ecore_dmae_execute_sub_operation failed. Invalid state. source_addr 0x%lx, destination addr 0x%lx, size_in_dwords 0x%x\n", + (unsigned long)src_addr, + (unsigned long)dst_addr, + length_cur); + return ECORE_INVAL; + } + ecore_dmae_opcode(p_hwfn, (src_type == ECORE_DMAE_ADDRESS_GRC), (dst_type == ECORE_DMAE_ADDRESS_GRC), p_params); -- 2.20.1