summaryrefslogtreecommitdiffstats
path: root/dpdk/dpdk-16.04_patches/0021-net-enic-fix-crash-when-releasing-queues.patch
diff options
context:
space:
mode:
authorJohn Lo <loj@cisco.com>2016-07-04 23:23:32 -0400
committerDamjan Marion <dmarion.lists@gmail.com>2016-07-05 16:21:35 +0000
commit55bf5c938585f0cc91b848ec37a5abfaf01f9515 (patch)
treedb08c0efcf55a9d13905616af27a8f819c2dc1c2 /dpdk/dpdk-16.04_patches/0021-net-enic-fix-crash-when-releasing-queues.patch
parentf727db9e6fb50b2930aedf18bcdda55fe0b96889 (diff)
ENIC driver patches to address various issues
Also clear x-bit for old patch files 0013-xxx and 0014-xxx. Change-Id: I217fdbfb32cef1ae575c668270d3baf593e688c6 Signed-off-by: John Lo <loj@cisco.com>
Diffstat (limited to 'dpdk/dpdk-16.04_patches/0021-net-enic-fix-crash-when-releasing-queues.patch')
-rw-r--r--dpdk/dpdk-16.04_patches/0021-net-enic-fix-crash-when-releasing-queues.patch61
1 files changed, 61 insertions, 0 deletions
diff --git a/dpdk/dpdk-16.04_patches/0021-net-enic-fix-crash-when-releasing-queues.patch b/dpdk/dpdk-16.04_patches/0021-net-enic-fix-crash-when-releasing-queues.patch
new file mode 100644
index 00000000000..56d2c677e1b
--- /dev/null
+++ b/dpdk/dpdk-16.04_patches/0021-net-enic-fix-crash-when-releasing-queues.patch
@@ -0,0 +1,61 @@
+From 38e154305ee5fd2ee454c19218ca144ffd1535f1 Mon Sep 17 00:00:00 2001
+From: John Daley <johndale@cisco.com>
+Date: Sat, 11 Jun 2016 10:27:04 -0700
+Subject: [PATCH 21/25] net/enic: fix crash when releasing queues
+
+If device configuration failed due to a lack of resources, such as
+if more queues are requested than are available, the queue release
+functions are called with NULL pointers which were being dereferenced.
+
+Skip releasing queues if they are NULL pointers.
+
+Fixes: fefed3d1e62c ("enic: new driver")
+
+Signed-off-by: John Daley <johndale@cisco.com>
+---
+ drivers/net/enic/enic_main.c | 21 ++++++++++++++++-----
+ 1 file changed, 16 insertions(+), 5 deletions(-)
+
+diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
+index 56ec96e..4e5594f 100644
+--- a/drivers/net/enic/enic_main.c
++++ b/drivers/net/enic/enic_main.c
+@@ -462,9 +462,15 @@ int enic_alloc_intr_resources(struct enic *enic)
+
+ void enic_free_rq(void *rxq)
+ {
+- struct vnic_rq *rq_sop = (struct vnic_rq *)rxq;
+- struct enic *enic = vnic_dev_priv(rq_sop->vdev);
+- struct vnic_rq *rq_data = &enic->rq[rq_sop->data_queue_idx];
++ struct vnic_rq *rq_sop, *rq_data;
++ struct enic *enic;
++
++ if (rxq == NULL)
++ return;
++
++ rq_sop = (struct vnic_rq *)rxq;
++ enic = vnic_dev_priv(rq_sop->vdev);
++ rq_data = &enic->rq[rq_sop->data_queue_idx];
+
+ enic_rxmbuf_queue_release(enic, rq_sop);
+ if (rq_data->in_use)
+@@ -657,9 +663,14 @@ err_exit:
+
+ void enic_free_wq(void *txq)
+ {
+- struct vnic_wq *wq = (struct vnic_wq *)txq;
+- struct enic *enic = vnic_dev_priv(wq->vdev);
++ struct vnic_wq *wq;
++ struct enic *enic;
++
++ if (txq == NULL)
++ return;
+
++ wq = (struct vnic_wq *)txq;
++ enic = vnic_dev_priv(wq->vdev);
+ rte_memzone_free(wq->cqmsg_rz);
+ vnic_wq_free(wq);
+ vnic_cq_free(&enic->cq[enic->rq_count + wq->index]);
+--
+2.7.0
+