All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Heiko Stübner" <heiko@sntech.de>
To: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>
Cc: linux-gpio@vger.kernel.org, linux-rockchip@lists.infradead.org,
	helen.koike@collabora.com, ezequiel@collabora.com,
	dafna3@gmail.com, kernel@collabora.com, linus.walleij@linaro.org
Subject: Re: [PATCH] pinctrl: rockchip: fix memleak in rockchip_dt_node_to_map
Date: Wed, 06 May 2020 12:57:41 +0200	[thread overview]
Message-ID: <12037872.zK0gPHFAvL@diego> (raw)
In-Reply-To: <20200506100903.15420-1-dafna.hirschfeld@collabora.com>

Am Mittwoch, 6. Mai 2020, 12:09:03 CEST schrieb Dafna Hirschfeld:
> In function rockchip_dt_node_to_map, a new_map variable is
> allocated by:
> 
> new_map = devm_kcalloc(pctldev->dev, map_num, sizeof(*new_map),
> 		       GFP_KERNEL);
> 
> This uses devres and attaches new_map to the pinctrl driver.
> This cause a leak since new_map is not released when the probed
> driver is removed. Fix it by using kcalloc to allocate new_map
> and free it in `rockchip_dt_free_map`
> 
> Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>

Reviewed-by: Heiko Stuebner <heiko@sntech.de>




  reply	other threads:[~2020-05-06 10:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-06 10:09 [PATCH] pinctrl: rockchip: fix memleak in rockchip_dt_node_to_map Dafna Hirschfeld
2020-05-06 10:57 ` Heiko Stübner [this message]
2020-05-12 17:46 ` Linus Walleij

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=12037872.zK0gPHFAvL@diego \
    --to=heiko@sntech.de \
    --cc=dafna.hirschfeld@collabora.com \
    --cc=dafna3@gmail.com \
    --cc=ezequiel@collabora.com \
    --cc=helen.koike@collabora.com \
    --cc=kernel@collabora.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    /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 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.