Commit 3b51096f authored by Alexey Dobriyan's avatar Alexey Dobriyan Committed by Dave Airlie

drm: use proc_create_data()

airlied: fixup race against drm info by filling out
tmp before adding it to proc.
Signed-off-by: default avatarAlexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent 882f0219
...@@ -110,20 +110,21 @@ int drm_proc_create_files(struct drm_info_list *files, int count, ...@@ -110,20 +110,21 @@ int drm_proc_create_files(struct drm_info_list *files, int count,
ret = -1; ret = -1;
goto fail; goto fail;
} }
ent = create_proc_entry(files[i].name, S_IFREG | S_IRUGO, root); tmp->minor = minor;
tmp->info_ent = &files[i];
list_add(&tmp->list, &minor->proc_nodes.list);
ent = proc_create_data(files[i].name, S_IRUGO, root,
&drm_proc_fops, tmp);
if (!ent) { if (!ent) {
DRM_ERROR("Cannot create /proc/dri/%s/%s\n", DRM_ERROR("Cannot create /proc/dri/%s/%s\n",
name, files[i].name); name, files[i].name);
list_del(&tmp->list);
kfree(tmp); kfree(tmp);
ret = -1; ret = -1;
goto fail; goto fail;
} }
ent->proc_fops = &drm_proc_fops;
ent->data = tmp;
tmp->minor = minor;
tmp->info_ent = &files[i];
list_add(&(tmp->list), &(minor->proc_nodes.list));
} }
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment