vmwgfx: Fix unitialized stack read in vmw_setup_otable_base
authorDave Jones <davej@redhat.com>
Fri, 31 Jan 2014 02:27:25 +0000 (21:27 -0500)
committerThomas Hellstrom <thellstrom@vmware.com>
Wed, 5 Feb 2014 07:52:34 +0000 (08:52 +0100)
One of the error paths in vmw_setup_otable_base causes us to return with
'ret' having never been set to anything causing us to return whatever was
on the stack.

Found with Coverity

Signed-off-by: Dave Jones <davej@fedoraproject.org>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
drivers/gpu/drm/vmwgfx/vmwgfx_mob.c

index 4910e7b..d4a5a19 100644 (file)
@@ -134,6 +134,7 @@ static int vmw_setup_otable_base(struct vmw_private *dev_priv,
        cmd = vmw_fifo_reserve(dev_priv, sizeof(*cmd));
        if (unlikely(cmd == NULL)) {
                DRM_ERROR("Failed reserving FIFO space for OTable setup.\n");
+               ret = -ENOMEM;
                goto out_no_fifo;
        }