Module: Mesa Branch: master Commit: eb61f8959e0a2de35dcfa518ea9963424fe715c4 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=eb61f8959e0a2de35dcfa518ea9963424fe715c4
Author: Michel Dänzer <[email protected]> Date: Tue Oct 27 11:40:05 2020 +0100 i965/bufmgr: Handle NULL bufmgr in brw_bufmgr_get_for_fd brw_bufmgr_create can return NULL, in which case we'd crash in list_addtail. Reported by Coverity/clang. Fixes: 4094558e8643 ("i965: share buffer managers across screens") Reviewed-by: Lionel Landwerlin <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7335> --- src/mesa/drivers/dri/i965/brw_bufmgr.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mesa/drivers/dri/i965/brw_bufmgr.c b/src/mesa/drivers/dri/i965/brw_bufmgr.c index f0d69379f5f..65488c85201 100644 --- a/src/mesa/drivers/dri/i965/brw_bufmgr.c +++ b/src/mesa/drivers/dri/i965/brw_bufmgr.c @@ -1947,7 +1947,8 @@ brw_bufmgr_get_for_fd(struct gen_device_info *devinfo, int fd, bool bo_reuse) } bufmgr = brw_bufmgr_create(devinfo, fd, bo_reuse); - list_addtail(&bufmgr->link, &global_bufmgr_list); + if (bufmgr) + list_addtail(&bufmgr->link, &global_bufmgr_list); unlock: mtx_unlock(&global_bufmgr_list_mutex); _______________________________________________ mesa-commit mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/mesa-commit
