diff --git a/block/blk-mq-debugfs.c b/block/blk-mq-debugfs.c index ba701e65446562c6941947921799d6737b71e9fa..20c074f9b11f77e83600307301cadb85976e3535 100644 --- a/block/blk-mq-debugfs.c +++ b/block/blk-mq-debugfs.c @@ -898,6 +898,9 @@ static const struct blk_mq_debugfs_attr blk_mq_debugfs_ctx_attrs[] = { static bool debugfs_create_files(struct dentry *parent, void *data, const struct blk_mq_debugfs_attr *attr) { + if (IS_ERR_OR_NULL(parent)) + return false; + d_inode(parent)->i_private = data; for (; attr->name; attr++) {