drm: fix messages about failed procfs/debugfs file registration
Subsystems (2)
PATCH 1/1 drm: fix messages about failed procfs/debugfs file registration
It printed garbage from stack:
[drm:drm_debugfs_create_files] *ERROR* Cannot create /sys/kernel/debug/dri/!.wy/2
--- drivers/gpu/drm/drm_debugfs.c | 3 +-- drivers/gpu/drm/drm_proc.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-)
drivers/gpu/drm/drm_debugfs.c +1 -2
@@ -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;
drivers/gpu/drm/drm_proc.c +1 -2
@@ -95,7 +95,6 @@ int drm_proc_create_files(struct drm_info_list *files, int count,struct drm_device *dev = minor->dev;struct proc_dir_entry *ent;struct drm_info_node *tmp; -char name[64 ];int i, ret;for (i =0 ; i < count; i++) {
@@ -118,7 +117,7 @@ int drm_proc_create_files(struct drm_info_list *files, int count, &drm_proc_fops, tmp);if (!ent) {DRM_ERROR ("Cannot create /proc/dri/%s/%s\n" , - name, files[i].name); + root->name, files[i].name);list_del (&tmp->list);kfree (tmp); ret =-1 ;
Signature · 1 line
1.7.6.1
Dave Airlie
maintainerQuoted 5 lines · Marcin Slusarz
It printed garbage from stack:
[drm:drm_debugfs_create_files] *ERROR* Cannot create /sys/kernel/debug/dri/!.wy/2Reported-by Daniel Yek <[email protected]>Signed-off-by Marcin Slusarz <[email protected]>
I have 4d5cb60d3f6c396899a515e0e667d0f855ed66ccqw
in my tree which seems to partly address this, please rebase onto drm-next.
Dave.
----- Original Message -----
Quoted 6 lines
From: "Dave Airlie" <[email protected]>
To: "Marcin Slusarz" <[email protected]>
Cc: "Daniel Yek" <[email protected]>, [email protected]
Sent: Monday, 10 October, 2011 9:00:19 AM
Subject: Re: [PATCH] drm: fix messages about failed procfs/debugfs file registration
Quoted 9 lines
Quoted 6 lines · Marcin Slusarz
It printed garbage from stack:
[drm:drm_debugfs_create_files] *ERROR* Cannot create /sys/kernel/debug/dri/!.wy/2Reported-by Daniel Yek <[email protected]>Signed-off-by Marcin Slusarz <[email protected]>
I have 4d5cb60d3f6c396899a515e0e667d0f855ed66cc
Typoed some vim onto the original mail.
Dave.
PATCH 1/2 drm: fix error message about failed procfs file registration
It printed garbage.
--- drivers/gpu/drm/drm_proc.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-)
drivers/gpu/drm/drm_proc.c +1 -2
@@ -95,7 +95,6 @@ int drm_proc_create_files(struct drm_info_list *files, int count,struct drm_device *dev = minor->dev;struct proc_dir_entry *ent;struct drm_info_node *tmp; -char name[64 ];int i, ret;for (i =0 ; i < count; i++) {
@@ -118,7 +117,7 @@ int drm_proc_create_files(struct drm_info_list *files, int count, &drm_proc_fops, tmp);if (!ent) {DRM_ERROR ("Cannot create /proc/dri/%s/%s\n" , - name, files[i].name); + root->name, files[i].name);list_del (&tmp->list);kfree (tmp); ret =-1 ;
Signature · 1 line
1.7.6.1
PATCH 2/2 drm: simplify error printing in drm_debugfs_create_files
In reply to David AirlieThere's no need to copy d_name.name.
--- drivers/gpu/drm/drm_debugfs.c | 5 +---- 1 files changed, 1 insertions(+), 4 deletions(-)
drivers/gpu/drm/drm_debugfs.c +1 -4
@@ -107,11 +107,8 @@ int drm_debugfs_create_files(struct drm_info_list *files, int count, ent =debugfs_create_file (files[i].name,S_IFREG |S_IRUGO , root, tmp, &drm_debugfs_fops);if (!ent) { -char name[64 ]; -strncpy (name, root->d_name.name, -min (root->d_name.len,64U ));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;
Signature · 1 line
1.7.6.1