summaryrefslogtreecommitdiff
path: root/extmod
diff options
context:
space:
mode:
authorDamien George <damien@micropython.org>2022-06-30 13:54:50 +1000
committerDamien George <damien@micropython.org>2022-06-30 13:54:50 +1000
commitf75e61105457732db355788e5ec1b734c348e4e0 (patch)
tree3a1da8e13c74c914a7aa92462d82013d2d522be3 /extmod
parentf1b5761ced7f19676b744ef24c201fb0ff084c2a (diff)
extmod/vfs: Prevent uninitialized variable warning for path_out.
The warning can appear when building in Release mode on the rp2 port. Signed-off-by: Damien George <damien@micropython.org>
Diffstat (limited to 'extmod')
-rw-r--r--extmod/vfs.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/extmod/vfs.c b/extmod/vfs.c
index 8e5e03632..8bcead190 100644
--- a/extmod/vfs.c
+++ b/extmod/vfs.c
@@ -100,6 +100,8 @@ STATIC mp_vfs_mount_t *lookup_path(mp_obj_t path_in, mp_obj_t *path_out) {
if (vfs != MP_VFS_NONE && vfs != MP_VFS_ROOT) {
*path_out = mp_obj_new_str_of_type(mp_obj_get_type(path_in),
(const byte *)p_out, strlen(p_out));
+ } else {
+ *path_out = MP_OBJ_NULL;
}
return vfs;
}