[openib-general] [PATCH] rdma_bind_addr() leaks a cma_dev reference count

Krishna Kumar2 krkumar2 at in.ibm.com
Tue Oct 17 22:15:32 PDT 2006


> Something similar to:
> 
> if (cma_any_addr...) {
>    ret = rdma_translate_ip(..);
>    if (ret)
>       goto err1;
> 
>    mutex_lock
>    ret = cma_acquire_dev
>    mutex_unlock
>    if (ret)
>       goto err2;
> }
> 
> should work fine.

Actually that will not work, since the undo operation is for when the
next operation (cma_get_port()) fails after we did an acquire_dev,
and in that case the refcount needs to be dropped. So I am not
able to avoid using an extra flag to indicate that a ref was got some
time in the past, and drop it in the error path. I will send that out now.

Thanks,

- KK





More information about the general mailing list