From: Radu Nicolau <radu.nicolau@intel.com>
To: dev@dpdk.org
Cc: marko.kovacevic@intel.com, john.mcnamara@intel.com,
declan.doherty@intel.com, Radu Nicolau <radu.nicolau@intel.com>
Subject: [dpdk-dev] [PATCH] examples/bond: add mbuf alloc check
Date: Mon, 22 Jan 2018 16:36:56 +0000 [thread overview]
Message-ID: <1516639016-28269-1-git-send-email-radu.nicolau@intel.com> (raw)
Fixes Coverity issue 257008
Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
---
examples/bond/main.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/examples/bond/main.c b/examples/bond/main.c
index 01e5eda..6c8a44a 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.7.5
next reply other threads:[~2018-01-22 16:42 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-22 16:36 Radu Nicolau [this message]
2018-01-23 17:42 ` Mcnamara, John
2018-01-24 13:16 ` [dpdk-dev] [PATCH v2] " Radu Nicolau
2018-02-01 0:21 ` [dpdk-dev] [dpdk-stable] " Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1516639016-28269-1-git-send-email-radu.nicolau@intel.com \
--to=radu.nicolau@intel.com \
--cc=declan.doherty@intel.com \
--cc=dev@dpdk.org \
--cc=john.mcnamara@intel.com \
--cc=marko.kovacevic@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).