modetest: Fix to check return value of asprintf()

There is warning about ignoring return value of 'asprintf'. Fix to
check return value of asprintf().

Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
main
Seung-Woo Kim 2018-01-10 11:16:41 +09:00 committed by Eric Engestrom
parent 1cc17744b9
commit 6736ad45d8
1 changed files with 4 additions and 1 deletions

View File

@ -656,10 +656,13 @@ static struct resources *get_resources(struct device *dev)
for (i = 0; i < res->res->count_connectors; i++) {
struct connector *connector = &res->connectors[i];
drmModeConnector *conn = connector->connector;
int num;
asprintf(&connector->name, "%s-%u",
num = asprintf(&connector->name, "%s-%u",
util_lookup_connector_type_name(conn->connector_type),
conn->connector_type_id);
if (num < 0)
goto error;
}
#define get_properties(_res, __res, type, Type) \