summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/llvmpipe/lp_state_setup.c
diff options
context:
space:
mode:
authorJosé Fonseca <[email protected]>2011-11-09 19:29:37 +0000
committerJosé Fonseca <[email protected]>2011-11-14 10:06:01 +0000
commitc88f3e0374620f18cf38d9fc3c45d14bc53f62b2 (patch)
tree05de7d375c47328da0097a62cbf239b442de85c4 /src/gallium/drivers/llvmpipe/lp_state_setup.c
parent9e29cdbe95810de8658dfd1cabf1a7d87264c2f7 (diff)
llvmpipe: Make more resilient to out-of-memory situations.
Most of the code was alright, but we were missing a few paths. Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_state_setup.c')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_state_setup.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_state_setup.c b/src/gallium/drivers/llvmpipe/lp_state_setup.c
index a9d9f4f4665..97c9238f989 100644
--- a/src/gallium/drivers/llvmpipe/lp_state_setup.c
+++ b/src/gallium/drivers/llvmpipe/lp_state_setup.c
@@ -874,10 +874,11 @@ llvmpipe_update_setup(struct llvmpipe_context *lp)
}
variant = generate_setup_variant(lp->gallivm, key, lp);
- insert_at_head(&lp->setup_variants_list, &variant->list_item_global);
- lp->nr_setup_variants++;
-
- llvmpipe_variant_count++;
+ if (variant) {
+ insert_at_head(&lp->setup_variants_list, &variant->list_item_global);
+ lp->nr_setup_variants++;
+ llvmpipe_variant_count++;
+ }
}
lp_setup_set_setup_variant(lp->setup,