summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/modetest/modetest.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/modetest/modetest.c b/tests/modetest/modetest.c
index c390d875..1fd5c77f 100644
--- a/tests/modetest/modetest.c
+++ b/tests/modetest/modetest.c
@@ -561,10 +561,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) \