From 0a41838becec8af2d80b90388072090ef2d0a4ad Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 26 Sep 2025 09:17:47 -0500 Subject: [PATCH] extmod/modopenamp: Check that mp_vfs_open actually returned a stream. Signed-off-by: Jeff Epler --- extmod/modopenamp_remoteproc_store.c | 1 + 1 file changed, 1 insertion(+) diff --git a/extmod/modopenamp_remoteproc_store.c b/extmod/modopenamp_remoteproc_store.c index 03022ebc83..7c2cee1099 100644 --- a/extmod/modopenamp_remoteproc_store.c +++ b/extmod/modopenamp_remoteproc_store.c @@ -76,6 +76,7 @@ static int openamp_remoteproc_store_open(void *store, const char *path, const vo openamp_remoteproc_filestore_t *fstore = store; fstore->file = mp_vfs_open(MP_ARRAY_SIZE(args), args, (mp_map_t *)&mp_const_empty_map); + (void)mp_get_stream_raise(fstore->file, MP_STREAM_OP_READ); int error = 0; mp_uint_t bytes = mp_stream_read_exactly(fstore->file, fstore->buf, RPROC_FILE_STORE_BUF_SIZE, &error);