[openib-general] [osm] segfault in libibumad

Bernhard Fischer rep.nop at aon.at
Fri Jun 10 12:46:14 PDT 2005


On Fri, Jun 10, 2005 at 03:22:32PM -0400, Hal Rosenstock wrote:
>On Fri, 2005-06-10 at 14:50, Bernhard Fischer wrote:

>> I'm not sure if userspace is supposed to work without sysfs. What do
>> you think?
>
>It shouldn't segv...

Yes, but should it work? I don't know if its possible and implemented
(in the long run) to get to and query the respective API versions in
order not to rely on sysfs.

>> In osm_vendor_init(), i'd set int r = -1, n_cas = -1; and would say
>> else\nif ((n_cas = umad_get_cas_names.
>> Also, in umad_get_cas_names() i guess only freeing namelist if
>> scandir did not return <0 may be better..
>
>Yes to both.

>Can you try this patch ? Thanks.

>-	free(namelist);
>+	if (n >= 0)
>+		free(namelist);
yes, should do.

>-	}
>+	} else
>+		r = n_cas = -1;
yes, but why not just initialize r and n_cas to -1?

thank you,
-- 
Bernhard



More information about the general mailing list