OSDN Git Service

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)
committerDavid S. Miller <davem@davemloft.net>
Fri, 29 Oct 2021 12:25:32 +0000 (13:25 +0100)
commitf8d384a640dd32aaf0a05fec137ccbf0e986b09f
tree844b589d6e182d4c8774c0c3c6ac3b3a23b20dc4
parente300a85db1f16a5805033feb56ec1861f02c7b1c
nfp: fix NULL pointer access when scheduling dim work

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>
drivers/net/ethernet/netronome/nfp/nfp_net_common.c