瀏覽代碼

zink: handle calloc-failure

In case we fail to allocate the context, we should notice and fail
gracefully.

CoverityID: 1455193
Reviewed-by: Dave Airlie <airlied@redhat.com>
master
Erik Faye-Lund 7 年之前
父節點
當前提交
8e1dca35ab
共有 1 個文件被更改,包括 2 次插入 和 0 次删除
  1. 2
    0
      src/gallium/drivers/zink/zink_context.c

+ 2
- 0
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;

Loading…
取消
儲存