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:
parent
21fa92a9ba
commit
7bebe12afe
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue