From: Declan Doherty <declan.doherty@intel.com>
To: dev@dpdk.org
Cc: stable@dpdk.org, Chas Williams <chas3@att.com>,
Declan Doherty <declan.doherty@intel.com>
Subject: [dpdk-dev] net/bonding: fix possible null pointer reference
Date: Tue, 8 Jan 2019 11:17:56 +0000 [thread overview]
Message-ID: <20190108111756.9118-1-declan.doherty@intel.com> (raw)
In function check_for_bonded_ethdev the driver name is used without
validating the pointer references in the passed ethdev object.
Fixes: 740feaf349b1 ("ethdev: remove driver name from device private data")
Cc: stable@dpdk.org
Signed-off-by: Declan Doherty <declan.doherty@intel.com>
---
drivers/net/bonding/rte_eth_bond_api.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/net/bonding/rte_eth_bond_api.c b/drivers/net/bonding/rte_eth_bond_api.c
index 21bcd5044..e5e146540 100644
--- a/drivers/net/bonding/rte_eth_bond_api.c
+++ b/drivers/net/bonding/rte_eth_bond_api.c
@@ -19,7 +19,10 @@ int
check_for_bonded_ethdev(const struct rte_eth_dev *eth_dev)
{
/* Check valid pointer */
- if (eth_dev->device->driver->name == NULL)
+ if (eth_dev == NULL ||
+ eth_dev->device == NULL ||
+ eth_dev->device->driver == NULL ||
+ eth_dev->device->driver->name == NULL)
return -1;
/* return 0 if driver name matches */
--
2.14.5
next reply other threads:[~2019-01-08 11:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-08 11:17 Declan Doherty [this message]
2019-01-09 14:04 ` Ferruh Yigit
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=20190108111756.9118-1-declan.doherty@intel.com \
--to=declan.doherty@intel.com \
--cc=chas3@att.com \
--cc=dev@dpdk.org \
--cc=stable@dpdk.org \
/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).