nfp: fix NULL pointer access when scheduling dim work
authorYinjun Zhang <yinjun.zhang@corigine.com>
Fri, 29 Oct 2021 11:29:02 +0000 (13:29 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Nov 2021 18:16:44 +0000 (19:16 +0100)
commite9f7832a4f141376559402fc4114a236a4cad416
tree7c353e248631be822181d711dd41a3d29d2f614d
parentd6c25579a8a04862f9e4f0e55a458ea0815f3cc8
nfp: fix NULL pointer access when scheduling dim work

[ Upstream commit f8d384a640dd32aaf0a05fec137ccbf0e986b09f ]

Each rx/tx ring has a related dim work, when rx/tx ring number is
decreased by `ethtool -L`, the corresponding rx_ring or tx_ring is
assigned NULL, while its related work is not destroyed. When scheduled,
the work will access NULL pointer.

Fixes: 9d32e4e7e9e1 ("nfp: add support for coalesce adaptive feature")
Signed-off-by: Yinjun Zhang <yinjun.zhang@corigine.com>
Signed-off-by: Louis Peens <louis.peens@corigine.com>
Signed-off-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/netronome/nfp/nfp_net_common.c