summaryrefslogtreecommitdiff
path: root/drivers/net
diff options
context:
space:
mode:
authorAjit Khaparde <ajit.khaparde@broadcom.com>2019-10-02 16:25:53 -0700
committerFerruh Yigit <ferruh.yigit@intel.com>2019-10-08 12:14:31 +0200
commit288d51eb188de7cb9cebfcfaf0d38bb283ec6187 (patch)
treee2b69436429cf59d09e22950d35a9cc870266965 /drivers/net
parent4cfbb0da7c3d8abd8172727dcf8139c059c8dfd0 (diff)
downloaddpdk-288d51eb188de7cb9cebfcfaf0d38bb283ec6187.zip
dpdk-288d51eb188de7cb9cebfcfaf0d38bb283ec6187.tar.gz
dpdk-288d51eb188de7cb9cebfcfaf0d38bb283ec6187.tar.xz
net/bnxt: check if device is started before flow creation
Check device is started before flow creation. Since the vnic data structures aren't created until device start, the driver dereferences NULL vnic if flow creation is attempted before device is started, Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com> Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com> Reviewed-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/bnxt/bnxt_flow.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/net/bnxt/bnxt_flow.c b/drivers/net/bnxt/bnxt_flow.c
index 4e6b4d7..e7b70f2 100644
--- a/drivers/net/bnxt/bnxt_flow.c
+++ b/drivers/net/bnxt/bnxt_flow.c
@@ -1550,6 +1550,15 @@ bnxt_flow_create(struct rte_eth_dev *dev,
return NULL;
}
+ if (!dev->data->dev_started) {
+ rte_flow_error_set(error,
+ EINVAL,
+ RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
+ NULL,
+ "Device must be started");
+ return NULL;
+ }
+
flow = rte_zmalloc("bnxt_flow", sizeof(struct rte_flow), 0);
if (!flow) {
rte_flow_error_set(error, ENOMEM,