diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2016-01-25 16:03:27 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2016-01-25 16:03:27 +0000 |
commit | 7bebe12afe549af3eceab35b29415f804949f994 (patch) | |
tree | e5f5fb587859818cc27395c813613510fbac4653 | |
parent | 21fa92a9ba254527a8661ddde837c7a4c5ff5493 (diff) |
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>
-rw-r--r-- | src/sna/sna_damage.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/sna/sna_damage.h b/src/sna/sna_damage.h index 36652556..d5c727ee 100644 --- a/src/sna/sna_damage.h +++ b/src/sna/sna_damage.h @@ -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; } |