[RAMEN9610-20877]ANDROID: fiq_debugger: remove
[GitHub/LineageOS/android_kernel_motorola_exynos9610.git] / block / blk-mq-debugfs.c
index de294d775acfa413854c109eeaa08b9b6bdfd354..d95439154556d58a6d33742c921112d144de09e3 100644 (file)
@@ -704,7 +704,11 @@ static ssize_t blk_mq_debugfs_write(struct file *file, const char __user *buf,
        const struct blk_mq_debugfs_attr *attr = m->private;
        void *data = d_inode(file->f_path.dentry->d_parent)->i_private;
 
-       if (!attr->write)
+       /*
+        * Attributes that only implement .seq_ops are read-only and 'attr' is
+        * the same with 'data' in this case.
+        */
+       if (attr == data || !attr->write)
                return -EPERM;
 
        return attr->write(data, buf, count, ppos);