]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx5: E-Switch, Use the correct error check on returned pointers
authorOr Gerlitz <ogerlitz@mellanox.com>
Thu, 9 Jun 2016 21:07:35 +0000 (00:07 +0300)
committerDavid S. Miller <davem@davemloft.net>
Fri, 10 Jun 2016 05:06:26 +0000 (22:06 -0700)
commit228be451dabb619ad547c800d8029fe321fec8ef
treed90a8909a9294f829523e63764c9caf29b1839cf
parent17907b7091d8d0d63315f754b1042d37ef5026cc
net/mlx5: E-Switch, Use the correct error check on returned pointers

The mlx5 flow-steering API (mlx5_create_flow_table/group/rule) never
returns null pointer on error. Even if it was doing that, checking
for IS_ERR_OR_NULL(p) and then returning PTR_ERR(p) would have cause
bugs, since PTR_ERR(NULL) --> success, crash.

To make things more robust and protect against related future bugs,
convert all IS_ERR_OR_NULL checks on returned values to IS_ERR.

Fixes: 2ff3d09fe911 ('net/mlx5: E-Switch, Introduce VST vport ingress/egress ACLs')
Fixes: 0f980ea3899a ('net/mlx5: Use flow steering infrastructure for mlx5_en')
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Reported-by: Ilya Lesokhin <ilyal@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx5/core/eswitch.c