lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Mon, 2 Mar 2020 09:54:27 +0100
From:   Pankaj Gupta <pankaj.gupta.linux@...il.com>
To:     mateusznosek0@...il.com
Cc:     linux-mm@...ck.org, linux-kernel@...r.kernel.org, hughd@...gle.com,
        Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH] mm/shmem.c: Clean code by removing unnecessary assignment

> From: Mateusz Nosek <mateusznosek0@...il.com>
>
> Previously 0 was assigned to variable 'error'
> but the variable was never read before reassignemnt later.
> So the assignment can be removed.
>
> Signed-off-by: Mateusz Nosek <mateusznosek0@...il.com>
> ---
>  mm/shmem.c | 9 +++------
>  1 file changed, 3 insertions(+), 6 deletions(-)
>
> diff --git a/mm/shmem.c b/mm/shmem.c
> index 31b4bcc95f17..84eb14f5509c 100644
> --- a/mm/shmem.c
> +++ b/mm/shmem.c
> @@ -3116,12 +3116,9 @@ static int shmem_symlink(struct inode *dir, struct dentry *dentry, const char *s
>
>         error = security_inode_init_security(inode, dir, &dentry->d_name,
>                                              shmem_initxattrs, NULL);
> -       if (error) {
> -               if (error != -EOPNOTSUPP) {
> -                       iput(inode);
> -                       return error;
> -               }
> -               error = 0;
> +       if (error && error != -EOPNOTSUPP) {
> +               iput(inode);
> +               return error;
>         }
>
>         inode->i_size = len-1;
> --
> 2.17.1

Acked-by : Pankaj Gupta <pankaj.gupta.linux@...il.com>

>
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ