[PATCH v3 3/3] device property: avoid allocations of 0 length

2015-12-29 Thread Andy Shevchenko
Arrays can not have zero elements by definition of the unified device properties. If such property comes from outside we should not allow it to pass. Otherwise memory allocation on 0 length will return non-NULL value, which we currently don't check. Prevent memory allocations of 0 length.

[PATCH v3 3/3] device property: avoid allocations of 0 length

2015-12-29 Thread Andy Shevchenko
Arrays can not have zero elements by definition of the unified device properties. If such property comes from outside we should not allow it to pass. Otherwise memory allocation on 0 length will return non-NULL value, which we currently don't check. Prevent memory allocations of 0 length.