summaryrefslogtreecommitdiff
path: root/lib/sysfs_utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sysfs_utils.c')
-rw-r--r--lib/sysfs_utils.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/sysfs_utils.c b/lib/sysfs_utils.c
index 983cb2d..6397342 100644
--- a/lib/sysfs_utils.c
+++ b/lib/sysfs_utils.c
@@ -54,6 +54,9 @@ int sysfs_get_mnt_path(char *mnt_path, size_t len)
static char sysfs_path[SYSFS_PATH_MAX] = "";
const char *sysfs_path_env;
+ if (len == 0 || mnt_path == NULL)
+ return -1;
+
/* evaluate only at the first call */
if (sysfs_path[0] == '\0') {
/* possible overrride of real mount path */