Skip to contentSkip to conversation

net/mlx4_core: destroy workqueue when driver fails to register

PATCH In review Wei Yang 3 participants 4 messages Dec 2, 2013 – 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 to destroy the workqueue allocated.

This patch destroies 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
Acked-by on v1 1/1
#1 lore raw
Quoted 16 lines · Wei Yang

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

This patch destroies 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 +0 -0
index 5789ea2..01fc651 100644

drivers/net/ethernet/mellanox/mlx4/main.c static int __init mlx4_init(void) · line 2642

Quoted 8 lines
drivers/net/ethernet/mellanox/mlx4/main.c +2 -0
@@ -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;
 }
 
#2 lore raw
In reply to Wei Yang
Quoted 2 lines · Wei Yang

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

please use "missed destroying" instead of "missed to destroy"

Quoted 2 lines

This patch destroies the workqueue when registration fails.

please s/destroies/destroys/

Quoted 26 lines
---
 drivers/net/ethernet/mellanox/mlx4/main.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/net/ethernet/mellanox/mlx4/main.c +2 -1
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;
 }
 
--

1.7.5.4

--
To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

author
#3 lore raw
Quoted 10 lines · Or Gerlitz
Quoted 2 lines · Wei Yang

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

please use "missed destroying" instead of "missed to destroy"

Quoted 2 lines

This patch destroies the workqueue when registration fails.

please s/destroies/destroys/

Ah, sorry for my poor English, will send another one.

Quoted 27 lines
Quoted 27 lines
---
 drivers/net/ethernet/mellanox/mlx4/main.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/net/ethernet/mellanox/mlx4/main.c +2 -1
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;
 }
 
--

1.7.5.4

--
To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 2 lines
Richard Yang
Help you, Help me