diff options
author | YueHaibing | 2018-08-08 14:29:08 +0200 |
---|---|---|
committer | David S. Miller | 2018-08-09 23:14:03 +0200 |
commit | cd16e5b233aadad5c4652f5466d1505a9f78bade (patch) | |
tree | 4b06039bfa89d028c274cf093deacc18216598f8 /drivers/net/ethernet | |
parent | net: sched: fix block->refcnt decrement (diff) | |
download | kernel-qcow2-linux-cd16e5b233aadad5c4652f5466d1505a9f78bade.tar.gz kernel-qcow2-linux-cd16e5b233aadad5c4652f5466d1505a9f78bade.tar.xz kernel-qcow2-linux-cd16e5b233aadad5c4652f5466d1505a9f78bade.zip |
mlxsw: spectrum_flower: use PTR_ERR_OR_ZERO()
Fix ptr_ret.cocci warnings:
drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c:543:1-3: WARNING: PTR_ERR_OR_ZERO can be used
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c index 75e5316ffebd..ebd1b24ebaa5 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c @@ -514,10 +514,9 @@ int mlxsw_sp_flower_tmplt_create(struct mlxsw_sp *mlxsw_sp, f->common.chain_index, MLXSW_SP_ACL_PROFILE_FLOWER, &rulei.values.elusage); - if (IS_ERR(ruleset)) - return PTR_ERR(ruleset); + /* keep the reference to the ruleset */ - return 0; + return PTR_ERR_OR_ZERO(ruleset); } void mlxsw_sp_flower_tmplt_destroy(struct mlxsw_sp *mlxsw_sp, |