mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 09:08:10 +02:00
pvr: add deferred RTA clear command to list after checking it's not NULL
The code that adds deferred RTA clear transfer commands checks whether the newly allocated transfer command is NULL. However the list_addtail call is before the check, which means that the check does not prevent NULL dereference. Reorder the code to ensure no NULL transfer commands would ever be added to the deferred clear list. In addition, pvr_transfer_cmd_alloc() has already set the command buffer's error status when it returns NULL, so it's not needed to set it again. Fixes:2eabbbe57d("pvr: use linked list to back deferred clears") Signed-off-by: Icenowy Zheng <zhengxingda@iscas.ac.cn> Reviewed-by: Luigi Santivetti <luigi.santivetti@imgtec.com> (cherry picked from commitecd4e93456) Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41402>
This commit is contained in:
parent
d8e22b980d
commit
32111204fe
2 changed files with 3 additions and 6 deletions
|
|
@ -2904,7 +2904,7 @@
|
|||
"description": "pvr: add deferred RTA clear command to list after checking it's not NULL",
|
||||
"nominated": true,
|
||||
"nomination_type": 2,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "2eabbbe57d1215695310ed8ce101be6a448a557e",
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -2005,14 +2005,11 @@ static VkResult pvr_add_deferred_rta_clear(struct pvr_cmd_buffer *cmd_buffer,
|
|||
continue;
|
||||
|
||||
transfer_cmd = pvr_transfer_cmd_alloc(cmd_buffer);
|
||||
if (!transfer_cmd)
|
||||
return VK_ERROR_OUT_OF_HOST_MEMORY;
|
||||
|
||||
list_addtail(&transfer_cmd->link, &cmd_buffer->deferred_clears);
|
||||
|
||||
if (!transfer_cmd) {
|
||||
return vk_command_buffer_set_error(&cmd_buffer->vk,
|
||||
VK_ERROR_OUT_OF_HOST_MEMORY);
|
||||
}
|
||||
|
||||
transfer_cmd->flags = PVR_TRANSFER_CMD_FLAGS_FILL;
|
||||
|
||||
if (attachment->aspectMask == VK_IMAGE_ASPECT_COLOR_BIT) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue