From: Don Skidmore Date: Sat, 2 Mar 2013 07:17:37 +0000 (+0000) Subject: ixgbe: fix possible divide by zero in ixgbe_update_itr X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=bdbeefe8ea8c7aa1e00397641e1f3dfa41a20968;p=openwrt%2Fstaging%2Fblogic.git ixgbe: fix possible divide by zero in ixgbe_update_itr Protect the code by bailing out of ixgbe_update_itr() when this occurs. The next call to ixgbe_update_itr will continue to dynamically update ITR. Signed-of-by: Don Skidmore Tested-by: Phil Schmitt Signed-off-by: Jeff Kirsher --- diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c index 6225f880a3f4..9afc959c1499 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c @@ -2095,6 +2095,9 @@ static void ixgbe_update_itr(struct ixgbe_q_vector *q_vector, */ /* what was last interrupt timeslice? */ timepassed_us = q_vector->itr >> 2; + if (timepassed_us == 0) + return; + bytes_perint = bytes / timepassed_us; /* bytes/usec */ switch (itr_setting) {