Commit 87c23028 authored by Shiraz Saleem's avatar Shiraz Saleem Committed by Jakub Kicinski
Browse files

net/mana: Null service_wq on setup error to prevent double destroy



In mana_gd_setup() error path, set gc->service_wq to NULL after
destroy_workqueue() to match the cleanup in mana_gd_cleanup().
This prevents a use-after-free if the workqueue pointer is checked
after a failed setup.

Fixes: f975a095 ("net: mana: Fix double destroy_workqueue on service rescan PCI path")
Signed-off-by: default avatarShiraz Saleem <shirazsaleem@microsoft.com>
Signed-off-by: default avatarKonstantin Taranov <kotaranov@microsoft.com>
Reviewed-by: default avatarSimon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20260309172443.688392-1-kotaranov@linux.microsoft.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent ead05405
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1934,6 +1934,7 @@ static int mana_gd_setup(struct pci_dev *pdev)
	mana_gd_remove_irqs(pdev);
free_workqueue:
	destroy_workqueue(gc->service_wq);
	gc->service_wq = NULL;
	dev_err(&pdev->dev, "%s failed (error %d)\n", __func__, err);
	return err;
}