From 893a2a428b3c400c78cf9e883a2faec52dc60687 Mon Sep 17 00:00:00 2001 From: "pr.jung" Date: Wed, 13 Feb 2019 16:29:48 +0900 Subject: [PATCH] Check parameter and return error Change-Id: Id539067762144bfdbf34b1b419d2126f5f8ac76e Signed-off-by: pr.jung --- include/storage-internal.h | 1 + src/storage-inhouse.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/include/storage-internal.h b/include/storage-internal.h index 609ebf5..a7ac3f8 100644 --- a/include/storage-internal.h +++ b/include/storage-internal.h @@ -155,6 +155,7 @@ typedef enum { * otherwise a negative error value * * @retval #STORAGE_ERROR_NONE Successful + * @retval #STORAGE_ERROR_INVALID_PARAMETER Invalid parameter * @retval #STORAGE_ERROR_OPERATION_FAILED Operation failed * @retval #STORAGE_ERROR_OUT_OF_MEMORY Out of memory */ diff --git a/src/storage-inhouse.c b/src/storage-inhouse.c index 946b4d8..5a9ca1f 100755 --- a/src/storage-inhouse.c +++ b/src/storage-inhouse.c @@ -429,6 +429,9 @@ API int storage_is_mounted_opt_usr(storage_part_mount_e *mounted) int ret; bool found = false; + if (!mounted) + return STORAGE_ERROR_INVALID_PARAMETER; + ret = blkid_get_cache(&cache, NULL); if (ret < 0) { _E("Failed to get cache"); //LCOV_EXCL_LINE -- 2.7.4