mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 09:08:10 +02:00
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:4094558e86("i965: share buffer managers across screens") Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7335> (cherry picked from commiteb61f8959e)
This commit is contained in:
parent
f06c466895
commit
436592d1f4
2 changed files with 3 additions and 2 deletions
|
|
@ -5557,7 +5557,7 @@
|
|||
"description": "i965/bufmgr: Handle NULL bufmgr in brw_bufmgr_get_for_fd",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"master_sha": null,
|
||||
"because_sha": "4094558e8643a266dfc8da9bc073751a3736a2fb"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue