summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorParvi Kaustubhi <pkaustub@cisco.com>2017-11-01 08:44:46 -0700
committerDavid S. Miller <davem@davemloft.net>2017-11-02 14:17:11 +0900
commite6cdfcc581866625980a89391be4e6a8b379d0c5 (patch)
treeb4a7374b46d9118e4db5e448cfd5856dc33e6c66
parent59c1cecce340d173234fd130c0647693a072009b (diff)
downloadtalos-op-linux-e6cdfcc581866625980a89391be4e6a8b379d0c5.tar.gz
talos-op-linux-e6cdfcc581866625980a89391be4e6a8b379d0c5.zip
enic: reset fetch index
Since we are allowing rx ring size modification, reset fetch index everytime. Otherwise it could have a stale value that can lead to a null pointer dereference. Signed-off-by: Govindarajulu Varadarajan <gvaradar@cisco.com> Signed-off-by: Parvi Kaustubhi <pkaustub@cisco.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/cisco/enic/vnic_rq.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/drivers/net/ethernet/cisco/enic/vnic_rq.c b/drivers/net/ethernet/cisco/enic/vnic_rq.c
index 36bc2c71fba9..f8aa326d1d58 100644
--- a/drivers/net/ethernet/cisco/enic/vnic_rq.c
+++ b/drivers/net/ethernet/cisco/enic/vnic_rq.c
@@ -139,20 +139,8 @@ void vnic_rq_init(struct vnic_rq *rq, unsigned int cq_index,
unsigned int error_interrupt_enable,
unsigned int error_interrupt_offset)
{
- u32 fetch_index = 0;
-
- /* Use current fetch_index as the ring starting point */
- fetch_index = ioread32(&rq->ctrl->fetch_index);
-
- if (fetch_index == 0xFFFFFFFF) { /* check for hardware gone */
- /* Hardware surprise removal: reset fetch_index */
- fetch_index = 0;
- }
-
- vnic_rq_init_start(rq, cq_index,
- fetch_index, fetch_index,
- error_interrupt_enable,
- error_interrupt_offset);
+ vnic_rq_init_start(rq, cq_index, 0, 0, error_interrupt_enable,
+ error_interrupt_offset);
}
unsigned int vnic_rq_error_status(struct vnic_rq *rq)
OpenPOWER on IntegriCloud