drm: Branch 'master'
[email protected] (Eric Engestr??m) Thu, 25 Jan 2018 10:53:32 +0000 (UTC)
| Newsgroups | gmane.comp.video.dri.patches |
|---|---|
| Message-ID | <[email protected]> |
tests/modetest/modetest.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) New commits: commit 6736ad45d88c4ce16c6f76fd128fae73b51ea2dc Author: Seung-Woo Kim <[email protected]> Date: Wed Jan 10 11:16:41 2018 +0900 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 <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> diff --git a/tests/modetest/modetest.c b/tests/modetest/modetest.c index 62d93327..0773bd02 100644 --- a/tests/modetest/modetest.c +++ b/tests/modetest/modetest.c @@ -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) \ ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot --