drm/nouveau/gem: fix object reference leak in a failure path
authorBen Skeggs <bskeggs@redhat.com>
Mon, 25 Jun 2012 08:04:27 +0000 (18:04 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Thu, 26 Jul 2012 00:28:14 +0000 (10:28 +1000)
Reported-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
drivers/gpu/drm/nouveau/nouveau_gem.c

index 30f5423169444ec841d9af44f0d816cb3547ae17..34d0bc59621342521ef9cfe4b81f109932fffd9d 100644 (file)
@@ -342,6 +342,7 @@ retry:
                if (nvbo->reserved_by && nvbo->reserved_by == file_priv) {
                        NV_ERROR(dev, "multiple instances of buffer %d on "
                                      "validation list\n", b->handle);
+                       drm_gem_object_unreference_unlocked(gem);
                        validate_fini(op, NULL);
                        return -EINVAL;
                }