From: Rasesh Mody Date: Sat, 7 Oct 2017 06:31:00 +0000 (-0700) Subject: net/qede/base: add check for DMA engine state X-Git-Tag: spdx-start~1552 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=b21e05c9cf943d427007d026b199575d6a172acb;p=dpdk.git 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 --- 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);