kernfs/file.c: remove redundant error return counter assignment
authorLin Feng <linf@wangsu.com>
Fri, 17 Jun 2022 09:17:46 +0000 (17:17 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 Jun 2022 14:44:40 +0000 (16:44 +0200)
Since previous 'rc = -EINVAL;', rc value doesn't change, so not
necessary to re-assign it again.

Signed-off-by: Lin Feng <linf@wangsu.com>
Link: https://lore.kernel.org/r/20220617091746.206515-1-linf@wangsu.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/kernfs/file.c

index e3abfa843879cd5b47e166ab9433237a00654cfe..54b2a13ac9a203caf080c2deea4ebd051817f6a0 100644 (file)
@@ -484,7 +484,6 @@ static int kernfs_fop_mmap(struct file *file, struct vm_area_struct *vma)
         * It is not possible to successfully wrap close.
         * So error if someone is trying to use close.
         */
-       rc = -EINVAL;
        if (vma->vm_ops && vma->vm_ops->close)
                goto out_put;