mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/2] GPU: drm_debugfs, check kmalloc retval
@ 2009-07-13 21:20 Jiri Slaby
  2009-07-13 21:20 ` [PATCH 2/2] GPU: drm_gem, check kzalloc retval Jiri Slaby
  0 siblings, 1 reply; 2+ messages in thread
From: Jiri Slaby @ 2009-07-13 21:20 UTC (permalink / raw)
  To: airlied; +Cc: dri-devel, linux-kernel, Jiri Slaby

Check kmalloc return value in drm_debugfs_create_files and bail out
appropriately if the pointer is NULL.

Signed-off-by: Jiri Slaby <jirislaby@gmail.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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-07-13 21:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-13 21:20 [PATCH 1/2] GPU: drm_debugfs, check kmalloc retval Jiri Slaby
2009-07-13 21:20 ` [PATCH 2/2] GPU: drm_gem, check kzalloc retval Jiri Slaby

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®