Hello Sam,

>> +        }
>> +#define MAX_COMPATIBLE_PROP     1024
>> +        cp = p = g_malloc0(MAX_COMPATIBLE_PROP);
>> +        i = 0;
>> +        while ((p - cp) < MAX_COMPATIBLE_PROP) {
>> +            int l;
>> +            if (xc->dt_compatible[i] == NULL) {
>> +                break;
>> +            }
>> +            l = strlen(xc->dt_compatible[i]);
>> +            if (l >= (MAX_COMPATIBLE_PROP - i)) {
> 
> The use of 'i' above doesn't look right. Should the check be more like this?
>                if ((l + 1) >= (MAX_COMPATIBLE_PROP - (p - cp))) {

David just proposed to move the compatible property setting in the
devnode op of the device, and so all this code should disappear at 
the same time.

Thanks,

C. 

>> +                break;
>> +            }
>> +            strcpy(p, xc->dt_compatible[i++]);
>> +            p += l + 1;
>> +        }
>> +        _FDT((fdt_setprop(fdt, child_offset, "compatible", cp, p - cp)));
>> +    }
>> +
>> +    return 0;
>> +}
>> +


Reply via email to