[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1247520021-31684-1-git-send-email-jirislaby@gmail.com>
Date: Mon, 13 Jul 2009 23:20:20 +0200
From: Jiri Slaby <jirislaby@...il.com>
To: airlied@...ux.ie
Cc: dri-devel@...ts.sourceforge.net, linux-kernel@...r.kernel.org,
Jiri Slaby <jirislaby@...il.com>
Subject: [PATCH 1/2] GPU: drm_debugfs, check kmalloc retval
Check kmalloc return value in drm_debugfs_create_files and bail out
appropriately if the pointer is NULL.
Signed-off-by: Jiri Slaby <jirislaby@...il.com>
---
drivers/gpu/drm/drm_debugfs.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/drivers/gpu/drm/drm_debugfs.c b/drivers/gpu/drm/drm_debugfs.c
index 2960b6d..9903f27 100644
--- a/drivers/gpu/drm/drm_debugfs.c
+++ b/drivers/gpu/drm/drm_debugfs.c
@@ -101,6 +101,10 @@ int drm_debugfs_create_files(struct drm_info_list *files, int count,
continue;
tmp = kmalloc(sizeof(struct drm_info_node), GFP_KERNEL);
+ if (tmp == NULL) {
+ ret = -1;
+ goto fail;
+ }
ent = debugfs_create_file(files[i].name, S_IFREG | S_IRUGO,
root, tmp, &drm_debugfs_fops);
if (!ent) {
--
1.6.3.2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists