net: korina: Fix NAPI versus resources freeing
authorFlorian Fainelli <f.fainelli@gmail.com>
Sat, 24 Dec 2016 03:56:56 +0000 (19:56 -0800)
committerWilly Tarreau <w@1wt.eu>
Thu, 2 Nov 2017 06:16:28 +0000 (07:16 +0100)
commit6ac502ceabf86463c4a35166851edf497960262f
tree71ca3c09ec1df9b31e631fdc5229e75c460c7495
parent18144201ec726dffd07cebf3df0cd2b799fc9fc0
net: korina: Fix NAPI versus resources freeing

commit e6afb1ad88feddf2347ea779cfaf4d03d3cd40b6 upstream.

Commit beb0babfb77e ("korina: disable napi on close and restart")
introduced calls to napi_disable() that were missing before,
unfortunately this leaves a small window during which NAPI has a chance
to run, yet we just freed resources since korina_free_ring() has been
called:

Fix this by disabling NAPI first then freeing resource, and make sure
that we also cancel the restart task before doing the resource freeing.

Fixes: beb0babfb77e ("korina: disable napi on close and restart")
Reported-by: Alexandros C. Couloumbis <alex@ozo.com>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Willy Tarreau <w@1wt.eu>
drivers/net/ethernet/korina.c