* [PATCH] drm: fix messages about failed procfs/debugfs file registration
@ 2011-10-09 18:38 Marcin Slusarz
2011-10-10 8:00 ` Dave Airlie
0 siblings, 1 reply; 5+ messages in thread
From: Marcin Slusarz @ 2011-10-09 18:38 UTC (permalink / raw)
To: dri-devel; +Cc: Daniel Yek
It printed garbage from stack:
[drm:drm_debugfs_create_files] *ERROR* Cannot create /sys/kernel/debug/dri/!.wy/2
Reported-by: Daniel Yek <danieyek@alumni.washington.edu>
Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Cc: stable@kernel.org
---
drivers/gpu/drm/drm_debugfs.c | 3 +--
drivers/gpu/drm/drm_proc.c | 3 +--
2 files changed, 2 insertions(+), 4 deletions(-)
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;
diff --git a/drivers/gpu/drm/drm_proc.c b/drivers/gpu/drm/drm_proc.c
index 9e5b07e..0f3c4e3 100644
--- a/drivers/gpu/drm/drm_proc.c
+++ b/drivers/gpu/drm/drm_proc.c
@@ -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;
--
1.7.6.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] drm: fix messages about failed procfs/debugfs file registration
2011-10-09 18:38 [PATCH] drm: fix messages about failed procfs/debugfs file registration Marcin Slusarz
@ 2011-10-10 8:00 ` Dave Airlie
2011-10-10 8:26 ` David Airlie
0 siblings, 1 reply; 5+ messages in thread
From: Dave Airlie @ 2011-10-10 8:00 UTC (permalink / raw)
To: Marcin Slusarz; +Cc: Daniel Yek, dri-devel
On Sun, Oct 9, 2011 at 7:38 PM, Marcin Slusarz <marcin.slusarz@gmail.com> wrote:
> It printed garbage from stack:
> [drm:drm_debugfs_create_files] *ERROR* Cannot create /sys/kernel/debug/dri/!.wy/2
>
> Reported-by: Daniel Yek <danieyek@alumni.washington.edu>
> Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
I have 4d5cb60d3f6c396899a515e0e667d0f855ed66ccqw
in my tree which seems to partly address this, please rebase onto drm-next.
Dave.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] drm: fix messages about failed procfs/debugfs file registration
2011-10-10 8:00 ` Dave Airlie
@ 2011-10-10 8:26 ` David Airlie
2011-10-10 17:32 ` [PATCH 1/2] drm: fix error message about failed procfs " Marcin Slusarz
2011-10-10 17:34 ` [PATCH 2/2] drm: simplify error printing in drm_debugfs_create_files Marcin Slusarz
0 siblings, 2 replies; 5+ messages in thread
From: David Airlie @ 2011-10-10 8:26 UTC (permalink / raw)
To: Dave Airlie; +Cc: Daniel Yek, dri-devel
----- Original Message -----
> From: "Dave Airlie" <airlied@gmail.com>
> To: "Marcin Slusarz" <marcin.slusarz@gmail.com>
> Cc: "Daniel Yek" <danieyek@alumni.washington.edu>, dri-devel@lists.freedesktop.org
> Sent: Monday, 10 October, 2011 9:00:19 AM
> Subject: Re: [PATCH] drm: fix messages about failed procfs/debugfs file registration
>
> On Sun, Oct 9, 2011 at 7:38 PM, Marcin Slusarz
> <marcin.slusarz@gmail.com> wrote:
> > It printed garbage from stack:
> > [drm:drm_debugfs_create_files] *ERROR* Cannot create
> > /sys/kernel/debug/dri/!.wy/2
> >
> > Reported-by: Daniel Yek <danieyek@alumni.washington.edu>
> > Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
>
I have 4d5cb60d3f6c396899a515e0e667d0f855ed66cc
Typoed some vim onto the original mail.
Dave.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/2] drm: fix error message about failed procfs file registration
2011-10-10 8:26 ` David Airlie
@ 2011-10-10 17:32 ` Marcin Slusarz
2011-10-10 17:34 ` [PATCH 2/2] drm: simplify error printing in drm_debugfs_create_files Marcin Slusarz
1 sibling, 0 replies; 5+ messages in thread
From: Marcin Slusarz @ 2011-10-10 17:32 UTC (permalink / raw)
To: David Airlie; +Cc: Daniel Yek, dri-devel
It printed garbage.
Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
---
drivers/gpu/drm/drm_proc.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/drm_proc.c b/drivers/gpu/drm/drm_proc.c
index 9e5b07e..0f3c4e3 100644
--- a/drivers/gpu/drm/drm_proc.c
+++ b/drivers/gpu/drm/drm_proc.c
@@ -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;
--
1.7.6.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/2] drm: simplify error printing in drm_debugfs_create_files
2011-10-10 8:26 ` David Airlie
2011-10-10 17:32 ` [PATCH 1/2] drm: fix error message about failed procfs " Marcin Slusarz
@ 2011-10-10 17:34 ` Marcin Slusarz
1 sibling, 0 replies; 5+ messages in thread
From: Marcin Slusarz @ 2011-10-10 17:34 UTC (permalink / raw)
To: David Airlie; +Cc: Emil Velikov, Daniel Yek, dri-devel
There's no need to copy d_name.name.
Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
---
drivers/gpu/drm/drm_debugfs.c | 5 +----
1 files changed, 1 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/drm_debugfs.c b/drivers/gpu/drm/drm_debugfs.c
index 9d2668a..b9dc262 100644
--- a/drivers/gpu/drm/drm_debugfs.c
+++ b/drivers/gpu/drm/drm_debugfs.c
@@ -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;
--
1.7.6.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-10-10 17:35 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-09 18:38 [PATCH] drm: fix messages about failed procfs/debugfs file registration Marcin Slusarz
2011-10-10 8:00 ` Dave Airlie
2011-10-10 8:26 ` David Airlie
2011-10-10 17:32 ` [PATCH 1/2] drm: fix error message about failed procfs " Marcin Slusarz
2011-10-10 17:34 ` [PATCH 2/2] drm: simplify error printing in drm_debugfs_create_files Marcin Slusarz
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.