mirror of
https://github.com/adulau/aha.git
synced 2024-12-29 12:16:20 +00:00
mlx4_en: Fix cleanup if workqueue create in mlx4_en_add() fails
If creating a workqueue fails, don't jump to the error path where that same workqueue is destroyed, since destroy_workqueue() can't handle a NULL pointer. This was spotted by the Coverity checker (CID 2617). Signed-off-by: Roland Dreier <rolandd@cisco.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
b1b243afac
commit
1a44cc3778
1 changed files with 2 additions and 3 deletions
|
@ -181,7 +181,7 @@ static void *mlx4_en_add(struct mlx4_dev *dev)
|
||||||
mdev->workqueue = create_singlethread_workqueue("mlx4_en");
|
mdev->workqueue = create_singlethread_workqueue("mlx4_en");
|
||||||
if (!mdev->workqueue) {
|
if (!mdev->workqueue) {
|
||||||
err = -ENOMEM;
|
err = -ENOMEM;
|
||||||
goto err_close_nic;
|
goto err_mr;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* At this stage all non-port specific tasks are complete:
|
/* At this stage all non-port specific tasks are complete:
|
||||||
|
@ -214,9 +214,8 @@ err_free_netdev:
|
||||||
flush_workqueue(mdev->workqueue);
|
flush_workqueue(mdev->workqueue);
|
||||||
|
|
||||||
/* Stop event queue before we drop down to release shared SW state */
|
/* Stop event queue before we drop down to release shared SW state */
|
||||||
|
|
||||||
err_close_nic:
|
|
||||||
destroy_workqueue(mdev->workqueue);
|
destroy_workqueue(mdev->workqueue);
|
||||||
|
|
||||||
err_mr:
|
err_mr:
|
||||||
mlx4_mr_free(dev, &mdev->mr);
|
mlx4_mr_free(dev, &mdev->mr);
|
||||||
err_uar:
|
err_uar:
|
||||||
|
|
Loading…
Reference in a new issue