Skip to content

Commit 139ae5e

Browse files
committed
openamp: Check that mp_vfs_open actually returned a stream.
Signed-off-by: Jeff Epler <jepler@unpythonic.net>
1 parent 4a397a7 commit 139ae5e

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

extmod/modopenamp_remoteproc_store.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ static int openamp_remoteproc_store_open(void *store, const char *path, const vo
7676

7777
openamp_remoteproc_filestore_t *fstore = store;
7878
fstore->file = mp_vfs_open(MP_ARRAY_SIZE(args), args, (mp_map_t *)&mp_const_empty_map);
79+
(void)mp_get_stream_raise(fstore->file, MP_STREAM_OP_READ);
7980

8081
int error = 0;
8182
mp_uint_t bytes = mp_stream_read_exactly(fstore->file, fstore->buf, RPROC_FILE_STORE_BUF_SIZE, &error);

0 commit comments

Comments
 (0)