Skip to content

Commit 1b85ee0

Browse files
Wei Yangdavem330
authored andcommitted
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>
1 parent 18fc25c commit 1b85ee0

File tree

1 file changed

+2
-0
lines changed
  • drivers/net/ethernet/mellanox/mlx4

1 file changed

+2
-0
lines changed

drivers/net/ethernet/mellanox/mlx4/main.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2635,6 +2635,8 @@ static int __init mlx4_init(void)
26352635
return -ENOMEM;
26362636

26372637
ret = pci_register_driver(&mlx4_driver);
2638+
if (ret < 0)
2639+
destroy_workqueue(mlx4_wq);
26382640
return ret < 0 ? ret : 0;
26392641
}
26402642

0 commit comments

Comments
 (0)