net: ethernet: mtk_eth_soc: fix flow block refcounting logic
authorFelix Fietkau <nbd@nbd.name>
Thu, 30 Mar 2023 12:08:38 +0000 (14:08 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 6 Apr 2023 10:10:49 +0000 (12:10 +0200)
commita7bd974edf12185341f85e1a2197b7065e2322d9
tree960bbfcf8e2876984e2782c59a9bf93eb0ce3dc0
parent1b0e8aba451031fa031bfb96711af12c4b902fdf
net: ethernet: mtk_eth_soc: fix flow block refcounting logic

[ Upstream commit 8c1cb87c2a5c29da416848451a687473f379611c ]

Since we call flow_block_cb_decref on FLOW_BLOCK_UNBIND, we also need to
call flow_block_cb_incref for a newly allocated cb.
Also fix the accidentally inverted refcount check on unbind.

Fixes: 502e84e2382d ("net: ethernet: mtk_eth_soc: add flow offloading support")
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Link: https://lore.kernel.org/r/20230330120840.52079-1-nbd@nbd.name
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/mediatek/mtk_ppe_offload.c