drm/vmwgfx: check kmalloc return value
authorRasmus Villemoes <linux@rasmusvillemoes.dk>
Tue, 15 Dec 2015 11:20:55 +0000 (12:20 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 15 Dec 2015 12:37:57 +0000 (13:37 +0100)
srf->sizes has been allocated and checked a few lines above; fix up
the copy-pasto so that we check srf->offsets.

Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1450178476-26284-8-git-send-email-boris.brezillon@free-electrons.com
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/vmwgfx/vmwgfx_surface.c

index a3ae985..c2a721a 100644 (file)
@@ -771,7 +771,7 @@ int vmw_surface_define_ioctl(struct drm_device *dev, void *data,
        }
        srf->offsets = kmalloc(srf->num_sizes * sizeof(*srf->offsets),
                               GFP_KERNEL);
-       if (unlikely(srf->sizes == NULL)) {
+       if (unlikely(srf->offsets == NULL)) {
                ret = -ENOMEM;
                goto out_no_offsets;
        }