Skip to content

panfrost: Fix Bo imports to not take the process down if fd is invalid

Carsten Haitzler requested to merge (removed):panfrost/fix-bo-import into master

If the calling process happens to use an invalid bo (e.g. fd has been closed), this led to lseek() returning -1 and this mmap trying to mmap a buffer of size -1 (0xffffffffffffffff ...) which led to mmap failing, which led to munmap failing which then led to the process aborting.

This fixes that to gracefully handle the mmap failures and percolate the failures back up through the API so eglCreateImage will not return a valid image anymore, thus the error is detectable in the caller process too.

/cc @alyssa @tomeu

Edited by Carsten Haitzler

Merge request reports

Loading