diff options
author | Vlad Buslov <vladbu@mellanox.com> | 2019-08-19 09:33:04 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-08-20 03:16:23 +0200 |
commit | 1edfb8ed6cc12107c2ec61b5be7bc881cfc4460e (patch) | |
tree | eb3ec422bff4b3c0e68f8dd9aca1918ccc43b4f2 /drivers | |
parent | Kconfig: Fix the reference to the IDT77105 Phy driver in the description of A... (diff) | |
download | linux-1edfb8ed6cc12107c2ec61b5be7bc881cfc4460e.tar.xz linux-1edfb8ed6cc12107c2ec61b5be7bc881cfc4460e.zip |
nfp: flower: verify that block cb is not busy before binding
When processing FLOW_BLOCK_BIND command on indirect block, check that flow
block cb is not busy.
Fixes: 0d4fd02e7199 ("net: flow_offload: add flow_block_cb_is_busy() and use it")
Reported-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: Vlad Buslov <vladbu@mellanox.com>
Acked-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ethernet/netronome/nfp/flower/offload.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/net/ethernet/netronome/nfp/flower/offload.c b/drivers/net/ethernet/netronome/nfp/flower/offload.c index e209f150c5f2..9917d64694c6 100644 --- a/drivers/net/ethernet/netronome/nfp/flower/offload.c +++ b/drivers/net/ethernet/netronome/nfp/flower/offload.c @@ -1416,6 +1416,13 @@ nfp_flower_setup_indr_tc_block(struct net_device *netdev, struct nfp_app *app, switch (f->command) { case FLOW_BLOCK_BIND: + cb_priv = nfp_flower_indr_block_cb_priv_lookup(app, netdev); + if (cb_priv && + flow_block_cb_is_busy(nfp_flower_setup_indr_block_cb, + cb_priv, + &nfp_block_cb_list)) + return -EBUSY; + cb_priv = kmalloc(sizeof(*cb_priv), GFP_KERNEL); if (!cb_priv) return -ENOMEM; |