summaryrefslogtreecommitdiffstatshomepage
path: root/unix
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2015-05-01 21:34:08 +0100
committerDamien George <damien.p.george@gmail.com>2015-05-01 21:34:08 +0100
commita9afcb159acacd0d605dd54fc69709650bd336b8 (patch)
tree881d548032ab41723ac67a4a39ecaf72886c16d1 /unix
parenta62c10697437df8af19f57d8a9aa9af21624a399 (diff)
downloadmicropython-a9afcb159acacd0d605dd54fc69709650bd336b8.tar.gz
micropython-a9afcb159acacd0d605dd54fc69709650bd336b8.zip
unix/modffi.c: get_buffer is allowed to return NULL if len=0.
This is consistent with the logic in mp_get_buffer, and the code here is an inlined version of that function.
Diffstat (limited to 'unix')
-rw-r--r--unix/modffi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/unix/modffi.c b/unix/modffi.c
index e0d86ad1d1..b268bf9e08 100644
--- a/unix/modffi.c
+++ b/unix/modffi.c
@@ -375,7 +375,7 @@ STATIC mp_obj_t ffifunc_call(mp_obj_t self_in, mp_uint_t n_args, mp_uint_t n_kw,
mp_obj_base_t *o = (mp_obj_base_t*)a;
mp_buffer_info_t bufinfo;
int ret = o->type->buffer_p.get_buffer(o, &bufinfo, MP_BUFFER_READ); // TODO: MP_BUFFER_READ?
- if (ret != 0 || bufinfo.buf == NULL) {
+ if (ret != 0) {
goto error;
}
values[i] = (ffi_arg)bufinfo.buf;