From 0bb76fc945e626941de2c6e881b69f4e4ef61478 Mon Sep 17 00:00:00 2001 From: Radu Nicolau Date: Wed, 24 Jan 2018 13:16:46 +0000 Subject: [PATCH] examples/bond: check mbuf allocation Coverity issue: 257008 Fixes: cc7e8ae84faa ("examples/bond: add example application for link bonding mode 6") Cc: stable@dpdk.org Signed-off-by: Radu Nicolau --- examples/bond/main.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/examples/bond/main.c b/examples/bond/main.c index b8efcafca3..455f108eeb 100644 --- a/examples/bond/main.c +++ b/examples/bond/main.c @@ -441,6 +441,11 @@ static void cmd_obj_send_parsed(void *parsed_result, (BOND_IP_3 << 16) | (BOND_IP_4 << 24); created_pkt = rte_pktmbuf_alloc(mbuf_pool); + if (created_pkt == NULL) { + cmdline_printf(cl, "Failed to allocate mbuf\n"); + return; + } + pkt_size = sizeof(struct ether_hdr) + sizeof(struct arp_hdr); created_pkt->data_len = pkt_size; created_pkt->pkt_len = pkt_size; -- 2.20.1