From: Dmitry Fleytman Date: Tue, 13 Oct 2015 09:48:18 +0000 (+0300) Subject: e1000e: fix division by zero on jumbo MTUs X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b77ac46bbae862dcb3f51296825c940404c69b0f;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git e1000e: fix division by zero on jumbo MTUs This patch fixes possible division by zero in receive interrupt handler when working without adaptive interrupt moderation. The adaptive interrupt moderation mechanism is typically disabled on jumbo MTUs. Signed-off-by: Dmitry Fleytman Signed-off-by: Leonid Bloch Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher --- diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c index 0003bf61b211..772447306c13 100644 --- a/drivers/net/ethernet/intel/e1000e/netdev.c +++ b/drivers/net/ethernet/intel/e1000e/netdev.c @@ -1959,8 +1959,10 @@ static irqreturn_t e1000_intr_msix_rx(int __always_unused irq, void *data) * previous interrupt. */ if (rx_ring->set_itr) { - writel(1000000000 / (rx_ring->itr_val * 256), - rx_ring->itr_register); + u32 itr = rx_ring->itr_val ? + 1000000000 / (rx_ring->itr_val * 256) : 0; + + writel(itr, rx_ring->itr_register); rx_ring->set_itr = 0; }