From 14ba4ee0ca1d57af489ceaa88876cb27ab25001b Mon Sep 17 00:00:00 2001 From: Baocheng Sun Date: Wed, 02 Aug 2017 05:23:19 +0000 Subject: 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 --- 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; } -- cgit