提交 d7f48231 编写于 作者: C Christophe JAILLET 提交者: Sinclair Yeh

drm/vmwgfx: Fix handling of errors returned by 'vmw_cotable_alloc()'

'vmw_cotable_alloc()' returns an error pointer on error, not NULL.
Propagate the error code, instead of returning -ENOMEM unconditionally
Signed-off-by: NChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: NSinclair Yeh <syeh@vmware.com>
Signed-off-by: NSinclair Yeh <syeh@vmware.com>
上级 1a4adb05
......@@ -209,8 +209,8 @@ static int vmw_gb_context_init(struct vmw_private *dev_priv,
for (i = 0; i < SVGA_COTABLE_DX10_MAX; ++i) {
uctx->cotables[i] = vmw_cotable_alloc(dev_priv,
&uctx->res, i);
if (unlikely(uctx->cotables[i] == NULL)) {
ret = -ENOMEM;
if (unlikely(IS_ERR(uctx->cotables[i]))) {
ret = PTR_ERR(uctx->cotables[i]);
goto out_cotables;
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册