summaryrefslogtreecommitdiff
path: root/atmel-samd/access_vfs.c
diff options
context:
space:
mode:
authorScott Shawcroft <scott@chickadee.tech>2017-08-07 15:56:10 -0700
committerScott Shawcroft <scott@chickadee.tech>2017-08-07 15:56:10 -0700
commit509d5223ea7153985a8afb3543ea386fa8f720bf (patch)
tree653d7106bf9d082805aec1e256768cb2c82d2129 /atmel-samd/access_vfs.c
parent6ace74466709e0a25c60375638afb5cc3471828c (diff)
atmel-samd: Fix crash when fs mount fails and fix mounting internal flash. It was broken by the update to 1.9.1. Related to #82
Diffstat (limited to 'atmel-samd/access_vfs.c')
-rw-r--r--atmel-samd/access_vfs.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/atmel-samd/access_vfs.c b/atmel-samd/access_vfs.c
index 0eb11b84e..e4a643c0b 100644
--- a/atmel-samd/access_vfs.c
+++ b/atmel-samd/access_vfs.c
@@ -45,6 +45,9 @@
// The root FS is always at the end of the list.
static fs_user_mount_t* get_vfs(int index) {
mp_vfs_mount_t* current_mount = MP_STATE_VM(vfs_mount_table);
+ if (current_mount == NULL) {
+ return NULL;
+ }
while (current_mount->next != NULL) {
current_mount = current_mount->next;
}