提交 7f76b23a 编写于 作者: M Mika Kuoppala 提交者: Daniel Vetter

drm/i915: check for oom when allocating private_default_ctx

Found with smatch
Signed-off-by: NMika Kuoppala <mika.kuoppala@intel.com>
Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
上级 76c3552f
...@@ -489,6 +489,10 @@ int i915_gem_context_open(struct drm_device *dev, struct drm_file *file) ...@@ -489,6 +489,10 @@ int i915_gem_context_open(struct drm_device *dev, struct drm_file *file)
/* Cheat for hang stats */ /* Cheat for hang stats */
file_priv->private_default_ctx = file_priv->private_default_ctx =
kzalloc(sizeof(struct i915_hw_context), GFP_KERNEL); kzalloc(sizeof(struct i915_hw_context), GFP_KERNEL);
if (file_priv->private_default_ctx == NULL)
return -ENOMEM;
file_priv->private_default_ctx->vm = &dev_priv->gtt.base; file_priv->private_default_ctx->vm = &dev_priv->gtt.base;
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册