sna/damage: Clear all-damaged NULL pointer on destroy

Remember to reset the all-damaged pointer, even if it is NULL.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2016-01-25 16:03:27 +00:00
parent 21fa92a9ba
commit 7bebe12afe
1 changed files with 3 additions and 2 deletions

View File

@ -319,10 +319,11 @@ static inline void sna_damage_reduce_all(struct sna_damage **_damage,
void __sna_damage_destroy(struct sna_damage *damage);
static inline void sna_damage_destroy(struct sna_damage **damage)
{
if (DAMAGE_PTR(*damage) == NULL)
if (*damage == NULL)
return;
__sna_damage_destroy(DAMAGE_PTR(*damage));
if (DAMAGE_PTR(*damage))
__sna_damage_destroy(DAMAGE_PTR(*damage));
*damage = NULL;
}