drm: proc: Use minor->index to label things, not PDE->name
Use minor->index to label things, not the name field from the proc_dir_entry of the /proc/dwm/<minor>/ directory. Also, use "%u" not "%d" to render the value and use a 12-byte buffer in which to render the integer, not a 16-byte buffer. The longest string an unsigned int can give you is 10 chars (4294967295) plus a NUL, so round up to 12 as the stack is likely to be 4- or 8-byte aligned. Signed-off-by: David Howells <dhowells@redhat.com> cc: dri-devel@lists.freedesktop.org Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
@@ -352,7 +352,7 @@ int drm_get_minor(struct drm_device *dev, struct drm_minor **minor, int type)
|
||||
idr_replace(&drm_minors_idr, new_minor, minor_id);
|
||||
|
||||
if (type == DRM_MINOR_LEGACY) {
|
||||
ret = drm_proc_init(new_minor, minor_id, drm_proc_root);
|
||||
ret = drm_proc_init(new_minor, drm_proc_root);
|
||||
if (ret) {
|
||||
DRM_ERROR("DRM: Failed to initialize /proc/dri.\n");
|
||||
goto err_mem;
|
||||
|
Reference in New Issue
Block a user