]> git.baikalelectronics.ru Git - kernel.git/commit
selftests: netdevsim: Always initialize 'RET' variable
authorIdo Schimmel <idosch@mellanox.com>
Thu, 21 May 2020 11:46:17 +0000 (14:46 +0300)
committerDavid S. Miller <davem@davemloft.net>
Fri, 22 May 2020 23:05:42 +0000 (16:05 -0700)
commit2fa4a6976bdf913baf06a28bc26949cfdc1f6d05
tree53a3c68f7272cfb870d352a6f5b8897b528d90e9
parentf5d3e7f78759572d2305b097137763c36b8e4d0f
selftests: netdevsim: Always initialize 'RET' variable

The variable is used by log_test() to check if the test case completely
successfully or not. In case it is not initialized at the start of a
test case, it is possible for the test case to fail despite not
encountering any errors.

Example:

```
...
TEST: Trap group statistics                                         [ OK ]
TEST: Trap policer                                                  [FAIL]
Policer drop counter was not incremented
TEST: Trap policer binding                                          [FAIL]
Policer drop counter was not incremented
```

Failure of trap_policer_test() caused trap_policer_bind_test() to fail
as well.

Fix by adding missing initialization of the variable.

Fixes: 212ca048440a ("selftests: netdevsim: Add test cases for devlink-trap policers")
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
tools/testing/selftests/drivers/net/netdevsim/devlink_trap.sh