Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1498176

Re: [PATCH 3/3] pinctrl: sunxi: Don't leak memory in case krealloc() failes

From Linus Walleij <linus.walleij@linaro.org>
Newsgroups linux.kernel
Subject Re: [PATCH 3/3] pinctrl: sunxi: Don't leak memory in case krealloc() failes
Date 2016-10-10 10:50 +0200
Message-ID <sqErw-7rt-31@gated-at.bofh.it> (permalink)
References <sn4Xf-1Ge-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri, Sep 30, 2016 at 2:14 PM, Johannes Thumshirn <jthumshirn@suse.de> wrote:

> If krealloc() fails there's no way of freeing the memory previously allocated
> for pctl->functions as it is overwritten by krealloc()'s return value. Fix
> this by assigning the return value to a temporary variable first so we can do
> error handling (which we didn't do at all before).
>
> Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>

Patch applied.

Yours,
Linus Walleij

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH 3/3] pinctrl: sunxi: Don't leak memory in case krealloc() failes Johannes Thumshirn <jthumshirn@suse.de> - 2016-09-30 14:20 +0200
  Re: [PATCH 3/3] pinctrl: sunxi: Don't leak memory in case krealloc() failes Linus Walleij <linus.walleij@linaro.org> - 2016-10-10 10:50 +0200

csiph-web