linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Walleij <linus.walleij@linaro.org>
To: Shawn Guo <shawnguo@kernel.org>
Cc: Dan Carpenter <dan.carpenter@oracle.com>,
	Baoyou Xie <xie.baoyou@sanechips.com.cn>,
	Xin Zhou <zhou.xin8@sanechips.com.cn>,
	Jun Nie <jun.nie@linaro.org>,
	"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	Shawn Guo <shawn.guo@linaro.org>
Subject: Re: [PATCH] pinctrl: zte: fix 'functions' allocation in zx_pinctrl_build_state()
Date: Wed, 2 Aug 2017 10:31:59 +0200	[thread overview]
Message-ID: <CACRpkdbXYOv8FdbWoiwL-4mhBN5JSP3D8iMMjFM1H2u-vgUC-A@mail.gmail.com> (raw)
In-Reply-To: <1500212008-29321-1-git-send-email-shawnguo@kernel.org>

On Sun, Jul 16, 2017 at 3:33 PM, Shawn Guo <shawnguo@kernel.org> wrote:

> From: Shawn Guo <shawn.guo@linaro.org>
>
> It fixes the following Smatch static check warning:
>
>  drivers/pinctrl/zte/pinctrl-zx.c:338 zx_pinctrl_build_state()
>  warn: passing devm_ allocated variable to kfree.
>
> As we will be calling krealloc() on pointer 'functions', which means
> kfree() will be called in there, devm_kzalloc() shouldn't be used with
> the allocation in the first place.  Fix the warning by calling kcalloc()
> and managing the free procedure in error path on our own.
>
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> Fixes: cbff0c4d27f4 ("pinctrl: add ZTE ZX pinctrl driver support")
> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>

Patch applied.

Yours,
Linus Walleij

      parent reply	other threads:[~2017-08-02  8:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-16 13:33 [PATCH] pinctrl: zte: fix 'functions' allocation in zx_pinctrl_build_state() Shawn Guo
2017-07-17  8:02 ` Dan Carpenter
2017-07-17  9:46   ` Shawn Guo
2017-07-17  9:55     ` Dan Carpenter
2017-08-02  8:31 ` Linus Walleij [this message]

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=CACRpkdbXYOv8FdbWoiwL-4mhBN5JSP3D8iMMjFM1H2u-vgUC-A@mail.gmail.com \
    --to=linus.walleij@linaro.org \
    --cc=dan.carpenter@oracle.com \
    --cc=jun.nie@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=shawn.guo@linaro.org \
    --cc=shawnguo@kernel.org \
    --cc=xie.baoyou@sanechips.com.cn \
    --cc=zhou.xin8@sanechips.com.cn \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).