summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSeung-Woo Kim <sw0312.kim@samsung.com>2017-03-17 19:24:24 +0900
committerSeung-Woo Kim <sw0312.kim@samsung.com>2017-03-17 19:24:28 +0900
commit721db6141da818e6e346f975510c4b2890461aee (patch)
tree5b1b4d5c85f6266799ca07e7667b47b1cb0457a9
parent9b8ed9dc473636293358a2da479bc29bb9d6bed8 (diff)
downloadlibdrm-721db6141da818e6e346f975510c4b2890461aee.tar.gz
libdrm-721db6141da818e6e346f975510c4b2890461aee.tar.bz2
libdrm-721db6141da818e6e346f975510c4b2890461aee.zip
ipptest: fix possible NULL deference in error path
This patch removes possible NULL deference in error path. Change-Id: I9f4c018adea3789e8d1f7e0e9b753a56b81ca88d Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
-rw-r--r--tests/ipptest/fimctest.c2
-rw-r--r--tests/rottest/rottest.c5
2 files changed, 3 insertions, 4 deletions
diff --git a/tests/ipptest/fimctest.c b/tests/ipptest/fimctest.c
index c95551bc..824f4c90 100644
--- a/tests/ipptest/fimctest.c
+++ b/tests/ipptest/fimctest.c
@@ -287,7 +287,6 @@ void connector_find_mode(struct connector *c)
if (!connector) {
fprintf(stderr, "could not get connector %i: %s\n",
resources->connectors[i], strerror(errno));
- drmModeFreeConnector(connector);
continue;
}
@@ -326,7 +325,6 @@ void connector_find_mode(struct connector *c)
if (!c->encoder) {
fprintf(stderr, "could not get encoder %i: %s\n",
resources->encoders[i], strerror(errno));
- drmModeFreeEncoder(c->encoder);
continue;
}
diff --git a/tests/rottest/rottest.c b/tests/rottest/rottest.c
index fdb2e7ac..ef0b69e9 100644
--- a/tests/rottest/rottest.c
+++ b/tests/rottest/rottest.c
@@ -160,6 +160,9 @@ static void dump_props(drmModeConnector *connector)
for (i = 0; i < connector->count_props; i++) {
props = drmModeGetProperty(fd, connector->props[i]);
+ if (!props)
+ continue;
+
printf("\t%s, flags %d\n", props->name, props->flags);
drmModeFreeProperty(props);
}
@@ -284,7 +287,6 @@ void connector_find_mode(struct connector *c)
if (!connector) {
fprintf(stderr, "could not get connector %i: %s\n",
resources->connectors[i], strerror(errno));
- drmModeFreeConnector(connector);
continue;
}
@@ -323,7 +325,6 @@ void connector_find_mode(struct connector *c)
if (!c->encoder) {
fprintf(stderr, "could not get encoder %i: %s\n",
resources->encoders[i], strerror(errno));
- drmModeFreeEncoder(c->encoder);
continue;
}