]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
IB/mlx5: Fix wrong error unwind
authorJason Gunthorpe <jgg@mellanox.com>
Thu, 20 Dec 2018 23:39:26 +0000 (16:39 -0700)
committerJason Gunthorpe <jgg@mellanox.com>
Fri, 21 Dec 2018 03:49:31 +0000 (20:49 -0700)
The destroy_workqueue on error unwind is missing, and the code jumps to
the wrong exit label.

Fixes: 813e90b1aeaa ("IB/mlx5: Add advise_mr() support")
Acked-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/hw/mlx5/main.c

index 9b40ec73cc646c9831a1f3284d5f45426de08e0e..75edb080435851eeee93d1181d7c10d5227d4ac9 100644 (file)
@@ -5775,12 +5775,14 @@ int mlx5_ib_stage_init_init(struct mlx5_ib_dev *dev)
        dev->advise_mr_wq = alloc_ordered_workqueue("mlx5_ib_advise_mr_wq", 0);
        if (!dev->advise_mr_wq) {
                err = -ENOMEM;
-               goto err_free_port;
+               goto err_mp;
        }
 
        err = init_srcu_struct(&dev->mr_srcu);
-       if (err)
-               goto err_free_port;
+       if (err) {
+               destroy_workqueue(dev->advise_mr_wq);
+               goto err_mp;
+       }
 #endif
 
        return 0;