author | Baocheng Sun <baocheng.sun@amlogic.com> | 2017-08-02 05:23:19 (GMT) |
---|---|---|
committer | Baocheng Sun <baocheng.sun@amlogic.com> | 2017-08-02 05:27:44 (GMT) |
commit | 14ba4ee0ca1d57af489ceaa88876cb27ab25001b (patch) | |
tree | a1e2ef2d5c7106f15cd1b83c6764eb2a48ed36cf | |
parent | 4c24653c01d701aa5c524a1c2110400681837146 (diff) | |
download | memtrack-ref-o-20171115.zip memtrack-ref-o-20171115.tar.gz memtrack-ref-o-20171115.tar.bz2 |
memtrack: return -ENODEV if type is not supported [1/2]
PD# NONE
memtrack for vts test compatibility
Change-Id: I7111aaaf1e2079a88ad2531ee09bb2de5feba262
Signed-off-by: Baocheng Sun <baocheng.sun@amlogic.com>
-rw-r--r-- | memtrack_aml.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/memtrack_aml.c b/memtrack_aml.c index 0109561..671c519 100644 --- a/memtrack_aml.c +++ b/memtrack_aml.c @@ -286,12 +286,13 @@ int aml_memtrack_get_memory(const struct memtrack_module *module, struct memtrack_record *records, size_t *num_records) { - if (type == MEMTRACK_TYPE_GL || type == MEMTRACK_TYPE_GRAPHICS) { - return memtrack_get_memory(pid, type, records, num_records); - - } else { + if (pid <= 0) return -EINVAL; - } + + if (type == MEMTRACK_TYPE_GL || type == MEMTRACK_TYPE_GRAPHICS) + return memtrack_get_memory(pid, type, records, num_records); + else + return -ENODEV; } |