[lustre-devel] staging: lustre: Optimize error handling in class_register_type()

SF Markus Elfring elfring at users.sourceforge.net
Tue Jul 26 13:11:00 PDT 2016

> NAK.
> when you do this, the next statement below breaks:

I wonder about this conclusion.

>> 	type = kzalloc(sizeof(*type), GFP_NOFS);
>> 	if (!type)
>> -		return rc;
>> +		return -ENOMEM;
>> 	type->typ_dt_ops = kzalloc(sizeof(*type->typ_dt_ops), GFP_NOFS);
>> 	if (!type->typ_dt_ops) {
>>                 goto failed;
>  failed:
>> return rc;
> So we are now returning an unitialized rc, did you get a gcc warning about it when compiling?

I do not get such an impression if my corresponding update suggestion
"[PATCH 04/12] staging: lustre: Split a condition check in class_register_type()"
will be considered for this use case once more.


More information about the lustre-devel mailing list