]> git.karo-electronics.de Git - linux-beck.git/commitdiff
staging: drm/omap: allocation fail check
authorRob Clark <rob@ti.com>
Sat, 10 Dec 2011 05:26:06 +0000 (23:26 -0600)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 13 Dec 2011 00:37:51 +0000 (16:37 -0800)
Signed-off-by: Rob Clark <rob@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/omapdrm/omap_gem.c

index 1054da3b2d254d208f5b93a8be28e8c7d717b90f..a451c572a59dce4e38245beb4d8780c068498a9c 100644 (file)
@@ -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++) {