Skip to contentSkip to conversation

net/mlx4_core: destroy workqueue when driver fails to register

PATCH Applied Wei Yang 2 participants 2 messages Dec 3, 2013

Subsystems (3)
lore
Share & tools
lore

Wei Yang

author
#0 lore raw

PATCH 1/1 net/mlx4_core: destroy workqueue when driver fails to register

When driver registration fails, we need to clean up the resources allocated before. mlx4_core missed destroying the workqueue allocated.

This patch destroys the workqueue when registration fails.

---
 drivers/net/ethernet/mellanox/mlx4/main.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/net/ethernet/mellanox/mlx4/main.c +2 -0
index 5789ea2..01fc651 100644
@@ -2635,6 +2635,8 @@ static int __init mlx4_init(void)
 		return -ENOMEM;
 
 	ret = pci_register_driver(&mlx4_driver);
+	if (ret < 0)
+		destroy_workqueue(mlx4_wq);
 	return ret < 0 ? ret : 0;
 }
 
Signature · 1 line
1.7.5.4
maintainer Applied
#1 lore raw

From: Wei Yang <[email protected]>
Date: Tue, 3 Dec 2013 10:04:10 +0800

Quoted 6 lines

When driver registration fails, we need to clean up the resources allocated before. mlx4_core missed destroying the workqueue allocated.

This patch destroys the workqueue when registration fails.

Applied.