OSDN Git Service

nouveau: turn another assertion into an error
authorBen Skeggs <skeggsb@beleth.(none)>
Wed, 4 Nov 2009 07:31:18 +0000 (17:31 +1000)
committerBen Skeggs <skeggsb@beleth.(none)>
Wed, 4 Nov 2009 07:31:18 +0000 (17:31 +1000)
Signed-off-by: Ben Skeggs <skeggsb@beleth.(none)>
libdrm/nouveau/nouveau_pushbuf.c

index df43eff..90250c0 100644 (file)
@@ -87,8 +87,12 @@ nouveau_pushbuf_emit_reloc(struct nouveau_channel *chan, void *ptr,
                domains |= NOUVEAU_GEM_DOMAIN_VRAM;
        if (flags & NOUVEAU_BO_GART)
                domains |= NOUVEAU_GEM_DOMAIN_GART;
+
+       if (!(pbbo->valid_domains & domains)) {
+               fprintf(stderr, "no valid domains remain!\n");
+               return -EINVAL;
+       }
        pbbo->valid_domains &= domains;
-       assert(pbbo->valid_domains);
 
        assert(flags & NOUVEAU_BO_RDWR);
        if (flags & NOUVEAU_BO_RD) {