From: Rob Clark Date: Sat, 10 Dec 2011 05:26:06 +0000 (-0600) Subject: staging: drm/omap: allocation fail check X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=b369839b88d6ffd9ad5b4f9362d6bb09a0e16c10;p=mv-sheeva.git staging: drm/omap: allocation fail check Signed-off-by: Rob Clark Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/omapdrm/omap_gem.c b/drivers/staging/omapdrm/omap_gem.c index 1054da3b2d2..a451c572a59 100644 --- a/drivers/staging/omapdrm/omap_gem.c +++ b/drivers/staging/omapdrm/omap_gem.c @@ -1094,6 +1094,10 @@ void omap_gem_init(struct drm_device *dev) } usergart = kzalloc(3 * sizeof(*usergart), GFP_KERNEL); + if (!usergart) { + dev_warn(dev->dev, "could not allocate usergart\n"); + return; + } /* reserve 4k aligned/wide regions for userspace mappings: */ for (i = 0; i < ARRAY_SIZE(fmts); i++) {