]> git.baikalelectronics.ru Git - kernel.git/commit
ionic: disable napi when ionic_lif_init() fails
authorBrett Creeley <brett@pensando.io>
Mon, 24 Jan 2022 18:53:09 +0000 (10:53 -0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 25 Jan 2022 11:15:09 +0000 (11:15 +0000)
commit7cf68fae0799dbb988d08fac7372927b34f9037e
treeadffb3c200eb021f7286548221927c40724fc6d8
parentd63ad4d84a4c40b12aeed5370880912f317bab52
ionic: disable napi when ionic_lif_init() fails

When the driver is going through reset, it will eventually call
ionic_lif_init(), which does a lot of re-initialization. One
of the re-initialization steps is to setup the adminq and
enable napi for it.  If something breaks after this point
we can end up with a kernel NULL pointer dereference through
ionic_adminq_napi.

Fix this by making sure to call napi_disable() in the cleanup
path of ionic_lif_init().  This forces any pending napi contexts
to finish and prevents them from being recalled before deleting
the napi context.

Fixes: ba4a30d80f73 ("ionic: Add notifyq support")
Signed-off-by: Brett Creeley <brett@pensando.io>
Signed-off-by: Shannon Nelson <snelson@pensando.io>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/pensando/ionic/ionic_lif.c