r600g: check NULL return from u_upload_alloc
authorJulien Isorce <jisorce@oblong.com>
Thu, 23 Mar 2017 13:34:07 +0000 (13:34 +0000)
committerJulien Isorce <jisorce@oblong.com>
Tue, 28 Mar 2017 16:54:15 +0000 (17:54 +0100)
commitc5fe99eec2d728ddd07115f43f274c07fa2d69b5
treea6445fd04fd550455cc7404d40c70f5a2a9abcc9
parent749cf3be6e18d2595123c9ae7f8fd262f15a02db
r600g: check NULL return from u_upload_alloc

Like done in si_state_draw.c::si_draw_vbo

u_upload_alloc can fail, i.e. set output param *ptr to NULL, for 2 reasons:
alloc fails or map fails. For both there is already a fprintf/stderr in
radeon_create_bo and radeon_bo_do_map.

In src/gallium/drivers/ it is a common usage to just avoid to crash by doing
a silent check. But defer fprintf where the error comes from, libdrm calls.

Signed-off-by: Julien Isorce <jisorce@oblong.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/drivers/r600/r600_state_common.c