All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kees Cook <keescook@chromium.org>
To: "Ola N. Kaldestad" <mail@okal.no>,
	Andrew Morton <akpm@linux-foundation.org>
Cc: "Luis R. Rodriguez" <mcgrof@kernel.org>,
	"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>
Subject: Re: [PATCH] Fix: code-style warning
Date: Mon, 13 Nov 2017 15:41:46 -0800	[thread overview]
Message-ID: <CAGXu5j+DOLmYyhrt=ymRq2BZQuPSxmVt+CJUinX_Z=fTNrho+g@mail.gmail.com> (raw)
In-Reply-To: <20171113232654.9473-1-mail@okal.no>

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

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

Acked-by: Kees Cook <keescook@chromium.org>

-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

       reply	other threads:[~2017-11-13 23:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20171113232654.9473-1-mail@okal.no>
2017-11-13 23:41 ` Kees Cook [this message]
2017-11-09 14:40 [PATCH] Fix " Ola N. Kaldestad

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAGXu5j+DOLmYyhrt=ymRq2BZQuPSxmVt+CJUinX_Z=fTNrho+g@mail.gmail.com' \
    --to=keescook@chromium.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=mail@okal.no \
    --cc=mcgrof@kernel.org \
    --subject='Re: [PATCH] Fix: code-style warning' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.