From: Jingjing Wu Date: Tue, 27 Jun 2017 13:29:13 +0000 (+0800) Subject: net/i40e/base: avoid potential null pointer dereference X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=156e15b5f711572570fdcf8b8541fcc465807b74;p=dpdk.git net/i40e/base: avoid potential null pointer dereference Signed-off-by: Jingjing Wu --- diff --git a/drivers/net/i40e/base/i40e_common.c b/drivers/net/i40e/base/i40e_common.c index 3f3b275d6c..78ed2a890a 100644 --- a/drivers/net/i40e/base/i40e_common.c +++ b/drivers/net/i40e/base/i40e_common.c @@ -330,13 +330,15 @@ void i40e_debug_aq(struct i40e_hw *hw, enum i40e_debug_mask mask, void *desc, void *buffer, u16 buf_len) { struct i40e_aq_desc *aq_desc = (struct i40e_aq_desc *)desc; - u16 len = LE16_TO_CPU(aq_desc->datalen); u8 *buf = (u8 *)buffer; + u16 len; u16 i = 0; if ((!(mask & hw->debug_mask)) || (desc == NULL)) return; + len = LE16_TO_CPU(aq_desc->datalen); + i40e_debug(hw, mask, "AQ CMD: opcode 0x%04X, flags 0x%04X, datalen 0x%04X, retval 0x%04X\n", LE16_TO_CPU(aq_desc->opcode),