Commit da7c74ea authored by Ben Skeggs's avatar Ben Skeggs

drm/gf100-/gr: fix -ENOSPC detection when allocating zbc table entries

Spotted by Coverity.
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent ef07ceae
...@@ -68,6 +68,9 @@ nvc0_graph_zbc_color_get(struct nvc0_graph_priv *priv, int format, ...@@ -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].ds, ds, sizeof(priv->zbc_color[zbc].ds));
memcpy(priv->zbc_color[zbc].l2, l2, sizeof(priv->zbc_color[zbc].l2)); memcpy(priv->zbc_color[zbc].l2, l2, sizeof(priv->zbc_color[zbc].l2));
priv->zbc_color[zbc].format = format; priv->zbc_color[zbc].format = format;
...@@ -109,6 +112,9 @@ nvc0_graph_zbc_depth_get(struct nvc0_graph_priv *priv, int 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].format = format;
priv->zbc_depth[zbc].ds = ds; priv->zbc_depth[zbc].ds = ds;
priv->zbc_depth[zbc].l2 = l2; priv->zbc_depth[zbc].l2 = l2;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment