diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2014-08-12 23:11:18 +1000 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2014-08-15 07:58:39 +1000 |
commit | da7c74ea2b0e218ddd6c3d01ea55a12104e7c6fd (patch) | |
tree | c632b9ace679b0e2aeeb26434769eea68f2f14f9 /drivers | |
parent | ef07ceae02271ac6eadc9f5cd652bb7162455a1b (diff) | |
download | linux-da7c74ea2b0e218ddd6c3d01ea55a12104e7c6fd.tar.bz2 |
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')
-rw-r--r-- | drivers/gpu/drm/nouveau/core/engine/graph/nvc0.c | 6 |
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; |