summaryrefslogtreecommitdiff
path: root/include/log.h
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2018-06-12 09:04:55 +0300
committerTom Rini <trini@konsulko.com>2018-06-18 21:43:14 +0300
commitc2e4e7e6316a1683be56618a5918732477742fbc (patch)
treea448e550dc9b28dd0a8aac68ab274f345d955a58 /include/log.h
parentb4c3fb087b06ec56cc325e2e73f8f497be89d129 (diff)
downloadu-boot-c2e4e7e6316a1683be56618a5918732477742fbc.tar.xz
log: Fix incorect range check in log_get_cat_name()
This allows access to an element after the end of the array. Fix it. Reported-by: Coverity (CID: 173279) Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/log.h')
-rw-r--r--include/log.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/log.h b/include/log.h
index a3edd25546..3e99d6e62b 100644
--- a/include/log.h
+++ b/include/log.h
@@ -274,7 +274,8 @@ struct log_filter {
* log_get_cat_name() - Get the name of a category
*
* @cat: Category to look up
- * @return category name (which may be a uclass driver name)
+ * @return category name (which may be a uclass driver name) if found, or
+ * "<invalid>" if invalid, or "<missing>" if not found
*/
const char *log_get_cat_name(enum log_category_t cat);