Merge branches 'for-4.4/upstream-fixes', 'for-4.5/async-suspend', 'for-4.5/container...
[cascardo/linux.git] / drivers / gpu / drm / nouveau / nouveau_gem.c
index 41be584..a0865c4 100644 (file)
@@ -84,8 +84,10 @@ nouveau_gem_object_open(struct drm_gem_object *gem, struct drm_file *file_priv)
                }
 
                ret = pm_runtime_get_sync(dev);
-               if (ret < 0 && ret != -EACCES)
+               if (ret < 0 && ret != -EACCES) {
+                       kfree(vma);
                        goto out;
+               }
 
                ret = nouveau_bo_vma_add(nvbo, cli->vm, vma);
                if (ret)
@@ -666,7 +668,7 @@ int
 nouveau_gem_ioctl_pushbuf(struct drm_device *dev, void *data,
                          struct drm_file *file_priv)
 {
-       struct nouveau_abi16 *abi16 = nouveau_abi16_get(file_priv, dev);
+       struct nouveau_abi16 *abi16 = nouveau_abi16_get(file_priv);
        struct nouveau_cli *cli = nouveau_cli(file_priv);
        struct nouveau_abi16_chan *temp;
        struct nouveau_drm *drm = nouveau_drm(dev);
@@ -682,7 +684,7 @@ nouveau_gem_ioctl_pushbuf(struct drm_device *dev, void *data,
                return -ENOMEM;
 
        list_for_each_entry(temp, &abi16->channels, head) {
-               if (temp->chan->user.handle == (NVDRM_CHAN | req->channel)) {
+               if (temp->chan->chid == req->channel) {
                        chan = temp->chan;
                        break;
                }