[Mesa-dev] [PATCH 6/6] nir: check malloc return value in print_block()
Kenneth Graunke
kenneth at whitecape.org
Wed Feb 11 05:43:42 PST 2015
On Tuesday, February 10, 2015 01:52:41 PM Juha-Pekka Heikkila wrote:
> Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila at gmail.com>
> ---
> src/glsl/nir/nir_print.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/src/glsl/nir/nir_print.c b/src/glsl/nir/nir_print.c
> index 9c07950..c250850 100644
> --- a/src/glsl/nir/nir_print.c
> +++ b/src/glsl/nir/nir_print.c
> @@ -646,6 +646,9 @@ print_block(nir_block *block, print_var_state *state, unsigned tabs, FILE *fp)
> nir_block **preds =
> malloc(block->predecessors->entries * sizeof(nir_block *));
>
> + if (!preds)
> + return;
> +
> struct set_entry *entry;
> unsigned i = 0;
> set_foreach(block->predecessors, entry) {
>
Thanks, this is better.
Acked-by: Kenneth Graunke <kenneth at whitecape.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20150211/9ab2da91/attachment.sig>
More information about the mesa-dev
mailing list