[RESEND PATCH 07/28] drm/vmwgfx: check kmalloc return value

Boris Brezillon boris.brezillon at free-electrons.com
Tue Dec 15 03:20:55 PST 2015


From: Rasmus Villemoes <linux at rasmusvillemoes.dk>

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 at intel.com>
Signed-off-by: Rasmus Villemoes <linux at rasmusvillemoes.dk>
Signed-off-by: Thierry Reding <treding at nvidia.com>
---
 drivers/gpu/drm/vmwgfx/vmwgfx_surface.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c b/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c
index a3ae985..c2a721a 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;
 	}
-- 
2.1.4



More information about the dri-devel mailing list