aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/core/engine
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2014-08-12 23:11:18 +1000
committerBen Skeggs <bskeggs@redhat.com>2014-08-15 07:58:39 +1000
commitda7c74ea2b0e218ddd6c3d01ea55a12104e7c6fd (patch)
treec632b9ace679b0e2aeeb26434769eea68f2f14f9 /drivers/gpu/drm/nouveau/core/engine
parentdrm/nouveau/nvif: return null pointers on failure, in addition to ret != 0 (diff)
downloadlinux-dev-da7c74ea2b0e218ddd6c3d01ea55a12104e7c6fd.tar.xz
linux-dev-da7c74ea2b0e218ddd6c3d01ea55a12104e7c6fd.zip
drm/gf100-/gr: fix -ENOSPC detection when allocating zbc table entries
Spotted by Coverity. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/core/engine')
-rw-r--r--drivers/gpu/drm/nouveau/core/engine/graph/nvc0.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/core/engine/graph/nvc0.c b/drivers/gpu/drm/nouveau/core/engine/graph/nvc0.c
index db19191176fa..30fd1dc64f93 100644
--- a/drivers/gpu/drm/nouveau/core/engine/graph/nvc0.c
+++ b/drivers/gpu/drm/nouveau/core/engine/graph/nvc0.c
@@ -68,6 +68,9 @@ nvc0_graph_zbc_color_get(struct nvc0_graph_priv *priv, int format,
}
}
+ if (zbc < 0)
+ return zbc;
+
memcpy(priv->zbc_color[zbc].ds, ds, sizeof(priv->zbc_color[zbc].ds));
memcpy(priv->zbc_color[zbc].l2, l2, sizeof(priv->zbc_color[zbc].l2));
priv->zbc_color[zbc].format = format;
@@ -109,6 +112,9 @@ nvc0_graph_zbc_depth_get(struct nvc0_graph_priv *priv, int format,
}
}
+ if (zbc < 0)
+ return zbc;
+
priv->zbc_depth[zbc].format = format;
priv->zbc_depth[zbc].ds = ds;
priv->zbc_depth[zbc].l2 = l2;