diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2011-09-05 03:43:04 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-09-16 16:50:36 -0400 |
commit | 9e393b3060ec4ed7e7c7c5de154e08e48c98f623 (patch) | |
tree | 94951da6c8fadeab0265aa825f6b95266a6ded60 /drivers/net/ethernet/sfc/falcon.c | |
parent | a0c4faf5484b1fe38952d5b975f19e9f4b8f0f2b (diff) |
sfc: Validate IRQ moderation parameters in efx_init_irq_moderation()
Add a range check, and move the check that RX and TX are consistent
from efx_ethtool_set_coalesce().
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/sfc/falcon.c')
-rw-r--r-- | drivers/net/ethernet/sfc/falcon.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/ethernet/sfc/falcon.c b/drivers/net/ethernet/sfc/falcon.c index 94bf4aaf984d..4dd1748a19c6 100644 --- a/drivers/net/ethernet/sfc/falcon.c +++ b/drivers/net/ethernet/sfc/falcon.c | |||
@@ -104,6 +104,8 @@ static void falcon_push_irq_moderation(struct efx_channel *channel) | |||
104 | efx_dword_t timer_cmd; | 104 | efx_dword_t timer_cmd; |
105 | struct efx_nic *efx = channel->efx; | 105 | struct efx_nic *efx = channel->efx; |
106 | 106 | ||
107 | BUILD_BUG_ON(EFX_IRQ_MOD_MAX > (1 << FRF_AB_TC_TIMER_VAL_WIDTH)); | ||
108 | |||
107 | /* Set timer register */ | 109 | /* Set timer register */ |
108 | if (channel->irq_moderation) { | 110 | if (channel->irq_moderation) { |
109 | EFX_POPULATE_DWORD_2(timer_cmd, | 111 | EFX_POPULATE_DWORD_2(timer_cmd, |