Re: [PATCH] Fix: code-style warning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Nov 13, 2017 at 3:26 PM, Ola N. Kaldestad <mail@xxxxxxx> wrote:
> Removed unnecessary else block, and removed redundant return and call to kfree in if block.
>
> Signed-off-by: Ola N. Kaldestad <mail@xxxxxxx>

Thanks for resending this. Andrew, can you take this clean-up, please?

Acked-by: Kees Cook <keescook@xxxxxxxxxxxx>

-Kees

> ---
>  kernel/sysctl.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/kernel/sysctl.c b/kernel/sysctl.c
> index d9c31bc2eaea..83b1685d3f15 100644
> --- a/kernel/sysctl.c
> +++ b/kernel/sysctl.c
> @@ -3089,14 +3089,11 @@ int proc_do_large_bitmap(struct ctl_table *table, int write,
>                         else
>                                 bitmap_copy(bitmap, tmp_bitmap, bitmap_len);
>                 }
> -               kfree(tmp_bitmap);
>                 *lenp -= left;
>                 *ppos += *lenp;
> -               return 0;
> -       } else {
> -               kfree(tmp_bitmap);
> -               return err;
>         }
> +       kfree(tmp_bitmap);
> +       return err;
>  }
>
>  #else /* CONFIG_PROC_SYSCTL */
> --
> 2.7.4
>



-- 
Kees Cook
Pixel Security



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux