Skip to content

Commit ec6c805

Browse files
solbjorndavem330
authored andcommitted
net: qede: fix use-after-free on recovery and AER handling
Set edev->cdev pointer to NULL after calling remove() callback to avoid using of already freed object. Fixes: ccc67ef ("qede: Error recovery process") Signed-off-by: Alexander Lobakin <[email protected]> Signed-off-by: Igor Russkikh <[email protected]> Signed-off-by: Michal Kalderon <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 1c85f39 commit ec6c805

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/net/ethernet/qlogic/qede/qede_main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1318,6 +1318,7 @@ static void __qede_remove(struct pci_dev *pdev, enum qede_remove_mode mode)
13181318
if (system_state == SYSTEM_POWER_OFF)
13191319
return;
13201320
qed_ops->common->remove(cdev);
1321+
edev->cdev = NULL;
13211322

13221323
/* Since this can happen out-of-sync with other flows,
13231324
* don't release the netdevice until after slowpath stop

0 commit comments

Comments
 (0)