Re: [PATCH] libibverbs init.c: remove stderr warnings if no userspace driver found

Yann Droneaud
2015-05-09T14:04:27Z

Hi,

Le vendredi 08 mai 2015 à 11:21 -0700, Jeff Squyres a écrit :
> Signed-off-by: Jeff Squyres <jsquyres-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>

This is a little short for an explanation: what was the issue with the
error messages ?

> ---
> src/init.c | 14 --------------
> 1 file changed, 14 deletions(-)
>
> diff --git a/src/init.c b/src/init.c
> index d0e4b1c..9c21768 100644
> --- a/src/init.c
> +++ b/src/init.c
> @@ -557,19 +557,5 @@ HIDDEN int ibverbs_init(struct ibv_device ***list)
> }
>
> out:
> - for (sysfs_dev = sysfs_dev_list,
> - next_dev = sysfs_dev ? sysfs_dev->next : NULL;
> - sysfs_dev;
> - sysfs_dev = next_dev, next_dev = sysfs_dev ? sysfs_dev->next : NULL) {
> - if (!sysfs_dev->have_driver) {
> - fprintf(stderr, PFX "Warning: no userspace device-specific "
> - "driver found for %s\n", sysfs_dev->sysfs_path);
> - if (statically_linked)
> - fprintf(stderr, " When linking libibverbs statically, "
> - "driver must be statically linked too.\n");
> - }
> - free(sysfs_dev);

I believe this free() was necessary to not leak some memory.

> - }
> -
> return num_devices;
> }

Regards.

--
Yann Droneaud
OPTEYA