CI found null pointer dereferences problem.
Coverity issue: 385406
Fixes: d7f6d9b21ffa ("net/nfp: adjust coding style for NFDk")
Cc: [email protected]
Signed-off-by: Chaoyong He <[email protected]>
Reviewed-by: Long Wu <[email protected]>
Reviewed-by: Peng Zhang <[email protected]>
---
drivers/net/nfp/nfdk/nfp_nfdk_dp.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/nfp/nfdk/nfp_nfdk_dp.c
b/drivers/net/nfp/nfdk/nfp_nfdk_dp.c
index 1f330b7bb6..0141fbcc8f 100644
--- a/drivers/net/nfp/nfdk/nfp_nfdk_dp.c
+++ b/drivers/net/nfp/nfdk/nfp_nfdk_dp.c
@@ -301,6 +301,9 @@ nfp_net_nfdk_xmit_pkts_common(void *tx_queue,
uint64_t metadata = 0;
pkt = *(tx_pkts + npkts);
+ if (pkt == NULL)
+ goto xmit_end;
+
nop_descs = nfp_net_nfdk_tx_maybe_close_block(txq, pkt);
if (nop_descs < 0)
goto xmit_end;
--
2.39.1