]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx4: fix some error handling in mlx4_multi_func_init()
authorRasmus Villemoes <linux@rasmusvillemoes.dk>
Tue, 9 Feb 2016 20:11:14 +0000 (21:11 +0100)
committerDoug Ledford <dledford@redhat.com>
Thu, 11 Feb 2016 16:04:54 +0000 (11:04 -0500)
commit812c541b3ee2194a16f2930596a47ea5f026b697
treebc1eeea96673e7aea80c4435cff6ca49a53fa82e
parentd9cb4391e8fb86efd1b7f8f75198dd36dfc0d4a6
net/mlx4: fix some error handling in mlx4_multi_func_init()

The while loop after err_slaves should use post-decrement; otherwise
we'll fail to do the kfrees for i==0, and will run into out-of-bounds
accesses if the setup above failed already at i==0.

[I'm not sure why one even bothers populating the ->vlan_filter array:
mlx4.h isn't #included by anything outside
drivers/net/ethernet/mellanox/mlx4/, and "git grep -C2 -w vlan_filter
drivers/net/ethernet/mellanox/mlx4/" seems to suggest that the
vlan_filter elements aren't used at all.]

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/net/ethernet/mellanox/mlx4/cmd.c