[MLX4] fix memory leakage in error flow. [mlnx: 4276]
[mirror/winof/.git] / hw / mlx4 / kernel / hca / mcast.c
index 49c70b9..7ae1f8a 100644 (file)
@@ -174,10 +174,10 @@ mlnx_detach_mcast (
                goto err_detach_mcast;\r
        }\r
 \r
-       kfree(p_mcast);\r
        status = IB_SUCCESS;\r
 \r
 err_detach_mcast:\r
+       kfree(p_mcast);\r
 err_unsupported:       \r
 err_invalid_param:\r
        if (status != IB_SUCCESS) \r