This patch should avoid the error being printed: https://patchwork.freedesktop.org/patch/315751/ However I suspect that the calling code will continue to crash -- we return a NULL pointer, and I suspect that the caller expects this to be non-null.