From: Shahed Shaikh Date: Sat, 27 Jan 2018 21:15:34 +0000 (-0800) Subject: net/qede: add check for null return X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=5c4e4fff189fff0ca861151135a9315da6f975b7;p=dpdk.git net/qede: add check for null return Test the return value of ecore_ptt_acquire for NULL. Coverity issue: 257049 Fixes: d378cefab84e ("net/qede: add support for GENEVE tunneling offload") Signed-off-by: Shahed Shaikh --- diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethdev.c index cab505914f..c3cea6de7a 100644 --- a/drivers/net/qede/qede_ethdev.c +++ b/drivers/net/qede/qede_ethdev.c @@ -681,7 +681,16 @@ qede_tunnel_update(struct qede_dev *qdev, for_each_hwfn(edev, i) { p_hwfn = &edev->hwfns[i]; - p_ptt = IS_PF(edev) ? ecore_ptt_acquire(p_hwfn) : NULL; + if (IS_PF(edev)) { + p_ptt = ecore_ptt_acquire(p_hwfn); + if (!p_ptt) { + DP_ERR(p_hwfn, "Can't acquire PTT\n"); + return -EAGAIN; + } + } else { + p_ptt = NULL; + } + rc = ecore_sp_pf_update_tunn_cfg(p_hwfn, p_ptt, tunn_info, ECORE_SPQ_MODE_CB, NULL); if (IS_PF(edev))