aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2020-05-22 16:05:42 -0700
committerDavid S. Miller <davem@davemloft.net>2020-05-22 16:05:42 -0700
commit7a40a2d22b79131a4826777864f39b19eaf7c857 (patch)
tree53a3c68f7272cfb870d352a6f5b8897b528d90e9 /drivers
parentMerge tag 'rxrpc-fixes-20200520' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs (diff)
parentselftests: netdevsim: Always initialize 'RET' variable (diff)
downloadwireguard-linux-7a40a2d22b79131a4826777864f39b19eaf7c857.tar.xz
wireguard-linux-7a40a2d22b79131a4826777864f39b19eaf7c857.zip
Merge branch 'netdevsim-Two-small-fixes'
Ido Schimmel says: ==================== netdevsim: Two small fixes Fix two bugs observed while analyzing regression failures. Patch #1 fixes a bug where sometimes the drop counter of a packet trap policer would not increase. Patch #2 adds a missing initialization of a variable in a related selftest. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/netdevsim/dev.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/net/netdevsim/dev.c b/drivers/net/netdevsim/dev.c
index 68668a22b9dd..dc3ff0e20944 100644
--- a/drivers/net/netdevsim/dev.c
+++ b/drivers/net/netdevsim/dev.c
@@ -858,8 +858,7 @@ nsim_dev_devlink_trap_policer_counter_get(struct devlink *devlink,
return -EINVAL;
cnt = &nsim_dev->trap_data->trap_policers_cnt_arr[policer->id - 1];
- *p_drops = *cnt;
- *cnt += jiffies % 64;
+ *p_drops = (*cnt)++;
return 0;
}