net/mlx4_core: destroy workqueue when driver fails to register
Subsystems (3)
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.
Signed-off-by Wei Yang <[email protected]>
--- drivers/net/ethernet/mellanox/mlx4/main.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
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 ; }
Signature · 1 line
1.7.5.4
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_coremissed destroying the workqueue allocated.This patch destroys the workqueue when registration fails.
Signed-off-by Wei Yang <[email protected]>
Applied.