diff mbox

[1/3] drm/omap: allocation fail check

Message ID 1323494768-11509-1-git-send-email-rob.clark@linaro.org
State Accepted
Commit b369839b88d6ffd9ad5b4f9362d6bb09a0e16c10
Headers show

Commit Message

Rob Clark Dec. 10, 2011, 5:26 a.m. UTC
From: Rob Clark <rob@ti.com>

Signed-off-by: Rob Clark <rob@ti.com>
---
 drivers/staging/omapdrm/omap_gem.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
diff mbox

Patch

diff --git a/drivers/staging/omapdrm/omap_gem.c b/drivers/staging/omapdrm/omap_gem.c
index 1054da3..a451c57 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++) {