diff options
author | Wei Yang <weiyang@linux.vnet.ibm.com> | 2013-12-03 03:04:10 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-12-03 17:55:44 +0100 |
commit | 1b85ee09aac2f32f24b8db72eb152089b92ace87 (patch) | |
tree | 1dcbe330799c884429ed9fdc8e44d1d9971b4b74 | |
parent | rds: prevent BUG_ON triggered on congestion update to loopback (diff) | |
download | linux-1b85ee09aac2f32f24b8db72eb152089b92ace87.tar.xz linux-1b85ee09aac2f32f24b8db72eb152089b92ace87.zip |
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 <weiyang@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx4/main.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c index 5789ea2c934d..01fc6515384d 100644 --- a/drivers/net/ethernet/mellanox/mlx4/main.c +++ b/drivers/net/ethernet/mellanox/mlx4/main.c @@ -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; } |