Message ID | 1455294689-29249-4-git-send-email-martin.peres@linux.intel.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Fri, Feb 12, 2016 at 06:31:25PM +0200, Martin Peres wrote: > Caught by Klockwork and I genuinely can't tell if it is safe without > it, especially since all the surrounding code is checking for NULL. Impossible. -Chris
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index 71a6207..8ceb1e1 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -3688,7 +3688,8 @@ sna_drawable_use_bo(DrawablePtr drawable, unsigned flags, const BoxRec *box, __FUNCTION__, priv->flush, priv->shm, priv->cpu, flags)); if ((flags & PREFER_GPU) == 0 && - (flags & (REPLACES | IGNORE_DAMAGE) || !priv->gpu_damage || !kgem_bo_is_busy(priv->gpu_bo))) { + (flags & (REPLACES | IGNORE_DAMAGE) || !priv->gpu_damage || + (priv->gpu_bo && !kgem_bo_is_busy(priv->gpu_bo)))) { DBG(("%s: try cpu as GPU bo is idle\n", __FUNCTION__)); goto use_cpu_bo; }
Caught by Klockwork and I genuinely can't tell if it is safe without it, especially since all the surrounding code is checking for NULL. Signed-off-by: Martin Peres <martin.peres@linux.intel.com> --- src/sna/sna_accel.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)