]> 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)
commit8c8faa246713fe754cfa7dfc28337aa61489ab07
treed90a8909a9294f829523e63764c9caf29b1839cf
parentf491690cce88c3dd3f0b0c6b774dab06b36c8dd2
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: 06173c049a98 ('net/mlx5: E-Switch, Introduce VST vport ingress/egress ACLs')
Fixes: 31024e97b214 ('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