From: Rasmus Villemoes Date: Tue, 15 Dec 2015 11:20:55 +0000 (+0100) Subject: drm/vmwgfx: check kmalloc return value X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=47ba614bb0e2b4633056547cd7507640db4ad0dd;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git drm/vmwgfx: check kmalloc return value 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 Signed-off-by: Rasmus Villemoes Signed-off-by: Thierry Reding Signed-off-by: Boris Brezillon Link: http://patchwork.freedesktop.org/patch/msgid/1450178476-26284-8-git-send-email-boris.brezillon@free-electrons.com Signed-off-by: Daniel Vetter --- diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c b/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c index a3ae9854405f..c2a721a8cef9 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c @@ -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; }