mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-23 05:56:14 -04:00
drm/debugfs: disallow debugfs access when device isn't registered
During device bringup it might be that we can't access the debugfs files. Return -ENODEV until the registration is completed on access. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230829110115.3442-3-christian.koenig@amd.com
This commit is contained in:
committed by
Christian König
parent
e76e7ec8f1
commit
7a0f217899
@@ -150,6 +150,9 @@ static int drm_debugfs_open(struct inode *inode, struct file *file)
|
||||
{
|
||||
struct drm_info_node *node = inode->i_private;
|
||||
|
||||
if (!device_is_registered(node->minor->kdev))
|
||||
return -ENODEV;
|
||||
|
||||
return single_open(file, node->info_ent->show, node);
|
||||
}
|
||||
|
||||
@@ -157,6 +160,10 @@ static int drm_debugfs_entry_open(struct inode *inode, struct file *file)
|
||||
{
|
||||
struct drm_debugfs_entry *entry = inode->i_private;
|
||||
struct drm_debugfs_info *node = &entry->file;
|
||||
struct drm_minor *minor = entry->dev->primary ?: entry->dev->accel;
|
||||
|
||||
if (!device_is_registered(minor->kdev))
|
||||
return -ENODEV;
|
||||
|
||||
return single_open(file, node->show, entry);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user