[Mesa-dev] [PATCH 2/9] i965: check malloc return value in intel_resolve_map_set()

Juha-Pekka Heikkila juhapekka.heikkila at gmail.com
Fri Jul 4 02:21:45 PDT 2014


On 04.07.2014 00:29, Kenneth Graunke wrote:
> On Thursday, July 03, 2014 11:13:12 AM Juha-Pekka Heikkila wrote:
>> Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila at gmail.com>
>> ---
>>  src/mesa/drivers/dri/i965/intel_resolve_map.c | 6 ++++++
>>  1 file changed, 6 insertions(+)
>>
>> diff --git a/src/mesa/drivers/dri/i965/intel_resolve_map.c 
> b/src/mesa/drivers/dri/i965/intel_resolve_map.c
>> index bf6bcf2..bb45231 100644
>> --- a/src/mesa/drivers/dri/i965/intel_resolve_map.c
>> +++ b/src/mesa/drivers/dri/i965/intel_resolve_map.c
>> @@ -22,6 +22,7 @@
>>   */
>>  
>>  #include "intel_resolve_map.h"
>> +#include "main/imports.h"
>>  
>>  #include <assert.h>
>>  #include <stdlib.h>
>> @@ -46,6 +47,11 @@ intel_resolve_map_set(struct exec_list *resolve_map,
>>     }
>>  
>>     struct intel_resolve_map *m = malloc(sizeof(struct intel_resolve_map));
>> +   if (m == NULL) {
>> +      _mesa_error_no_memory(__func__);
>> +      return;
>> +   }
>> +
>>     exec_node_init(&m->link);
>>     m->level = level;
>>     m->layer = layer;
>>
> 
> NAK.
> 

On this I see Piglit giving new crashes when I force error here but all
of the crashes come with comment:

Mesa: User error: GL_OUT_OF_MEMORY in out of memory in intel_resolve_map_set
fbo-depthstencil:
/home/jheikkil/workspace/piglit/tests/fbo/fbo-depthstencil.c:483:
piglit_display: Assertion `piglit_dispatch_glGetError() == 0' failed.


I though that is acceptable since the failure is forced?

/Juha-Pekka


More information about the mesa-dev mailing list