Skip to content

Commit

Permalink
net/mlx4_core: destroy workqueue when driver fails to register
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Wei Yang authored and David S. Miller committed Dec 3, 2013
1 parent 18fc25c commit 1b85ee0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/net/ethernet/mellanox/mlx4/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 1b85ee0

Please sign in to comment.