diff mbox

DRM: drm_debugfs_create_files uses unitialized stack in error printk

Message ID 20110511162605.2542.35528.stgit@paris.rdu.redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Eric Paris May 11, 2011, 4:26 p.m. UTC
drm_debugfs_create_files declares a char buf on the stack and prints it's
value in a error condition.  Before 28a62277 this character buf was filled
in but now it isn't.  Instead we can now get the name from the parent dentry
and don't need this at all.  Before this patch I would see a message like
below on every boot:

[drm:drm_debugfs_create_files] *ERROR* Cannot create /sys/kernel/debug/dri/I?5^B???/3

Signed-off-by: Eric Paris <eparis@redhat.com>
---

 drivers/gpu/drm/drm_debugfs.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/drivers/gpu/drm/drm_debugfs.c b/drivers/gpu/drm/drm_debugfs.c
index 9d8c892..b9dc262 100644
--- a/drivers/gpu/drm/drm_debugfs.c
+++ b/drivers/gpu/drm/drm_debugfs.c
@@ -90,7 +90,6 @@  int drm_debugfs_create_files(struct drm_info_list *files, int count,
 	struct drm_device *dev = minor->dev;
 	struct dentry *ent;
 	struct drm_info_node *tmp;
-	char name[64];
 	int i, ret;
 
 	for (i = 0; i < count; i++) {
@@ -109,7 +108,7 @@  int drm_debugfs_create_files(struct drm_info_list *files, int count,
 					  root, tmp, &drm_debugfs_fops);
 		if (!ent) {
 			DRM_ERROR("Cannot create /sys/kernel/debug/dri/%s/%s\n",
-				  name, files[i].name);
+				  root->d_name.name, files[i].name);
 			kfree(tmp);
 			ret = -1;
 			goto fail;