Message ID | 1828884A29C6694DAF28B7E6B8A823730119BA@ORSMSX101.amr.corp.intel.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Hi, Le vendredi 27 mai 2011 à 18:01 +0000, Hefty, Sean a écrit : > > ibv_get_device_list() returns the array of available RDMA devices, or > > sets errno and returns NULL if the request fails. If no devices are > > found then num_devices is set to 0, and non-NULL is returned. > > Thanks. I think the following fixes the same issue. If this looks okay to you, I'll will commit. > You're not handling the error case when ibv_get_device_list() returns NULL. We need two different error path: one for NULL and one for empty list. In the latter case, the list must be freed. Regards.
diff --git a/src/cma.c b/src/cma.c index 846b5ce..86cb455 100755 --- a/src/cma.c +++ b/src/cma.c @@ -247,7 +247,7 @@ int ucma_init(void) goto err1; dev_list = ibv_get_device_list(&dev_cnt); - if (!dev_list) { + if (!dev_cnt) { printf("CMA: unable to get RDMA device list\n"); ret = ERR(ENODEV); goto err1;