Hi, 

Le vendredi 27 mai 2011 à 09:22 -0700, Roland Dreier a écrit :
> >> This patch fixes SEGFAULT in libibverbs in case when there are no user
> >> space drivers found. I've cloned the libibverbs from
> >> git://git.openfabrics.org/ofed_1_1_5/libibverbs.git (I hope this is
> >> correct)
> 
> Thanks for the patches.  I think I would prefer to fix this more like the
> following (sorry for the attachment, using the gmail web interface ATM).
> This actually simplifies things I think, and sticks to the original idea
> that we should only be calling ibverbs_init once.
> 
> I only compile tested this, can one of you guys confirm this also fixes
> the problem?
> 

It fixes the problem of segfault on empty driver list.

But __ibv_get_device_list() returns a non NULL pointer when there's no
device.

> -       if (!num_devices)
> -               num_devices = ibverbs_init(&device_list);
> +       pthread_once(&device_list_once, count_devices);
 
It miss

        if (!num_devices)
               return NULL;

>        if (num_devices < 0) {
>                errno = -num_devices;
>-               goto out;
>+               return NULL;
>        }

Tested-by: Yann Droneaud <[email protected]>

BTW, my others patches are still interesting.

Regards.

-- 
Yann Droneaud
OPTEYA



--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to