diff options
author | Erik Faye-Lund <[email protected]> | 2019-11-27 17:31:28 +0100 |
---|---|---|
committer | Erik Faye-Lund <[email protected]> | 2019-11-29 09:54:25 +0100 |
commit | 8e1dca35abe13b57b34ea30d14f9ed55f558af14 (patch) | |
tree | facf1820a301ecf506ad3f3c2f9f0d33b3fe3b21 /src/gallium | |
parent | 8772d95d40367a2e27aef2127213a99540625632 (diff) |
zink: handle calloc-failure
In case we fail to allocate the context, we should notice and fail
gracefully.
CoverityID: 1455193
Reviewed-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/drivers/zink/zink_context.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c index 9b057fa165e..f79e289727d 100644 --- a/src/gallium/drivers/zink/zink_context.c +++ b/src/gallium/drivers/zink/zink_context.c @@ -1041,6 +1041,8 @@ zink_context_create(struct pipe_screen *pscreen, void *priv, unsigned flags) { struct zink_screen *screen = zink_screen(pscreen); struct zink_context *ctx = CALLOC_STRUCT(zink_context); + if (!ctx) + goto fail; ctx->base.screen = pscreen; ctx->base.priv = priv; |