Skip to content

Commit 43cfed7

Browse files
brettcreeleydavem330
authored andcommitted
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: 77ceb68 ("ionic: Add notifyq support") Signed-off-by: Brett Creeley <[email protected]> Signed-off-by: Shannon Nelson <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 238a0f7 commit 43cfed7

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/net/ethernet/pensando/ionic/ionic_lif.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3266,6 +3266,7 @@ int ionic_lif_init(struct ionic_lif *lif)
32663266
return 0;
32673267

32683268
err_out_notifyq_deinit:
3269+
napi_disable(&lif->adminqcq->napi);
32693270
ionic_lif_qcq_deinit(lif, lif->notifyqcq);
32703271
err_out_adminq_deinit:
32713272
ionic_lif_qcq_deinit(lif, lif->adminqcq);

0 commit comments

Comments
 (0)