[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CACRpkdY07ciT_0FCOuWGV3dbfcsyDpAqy4Aon_WN1gA8QS6a-A@mail.gmail.com>
Date: Mon, 25 Oct 2021 01:43:33 +0200
From: Linus Walleij <linus.walleij@...aro.org>
To: Yang Yingliang <yangyingliang@...wei.com>
Cc: linux-kernel <linux-kernel@...r.kernel.org>,
"open list:GPIO SUBSYSTEM" <linux-gpio@...r.kernel.org>
Subject: Re: [PATCH] pinctrl: core: fix possible memory leak in pinctrl_enable()
On Fri, Oct 22, 2021 at 3:36 AM Yang Yingliang <yangyingliang@...wei.com> wrote:
> I got memory leak as follows when doing fault injection test:
>
> unreferenced object 0xffff888020a7a680 (size 64):
> comm "i2c-mcp23018-41", pid 23090, jiffies 4295160544 (age 8.680s)
> hex dump (first 32 bytes):
> 00 48 d3 1e 80 88 ff ff 00 1a 56 c1 ff ff ff ff .H........V.....
> 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
> backtrace:
> [<0000000083c79b35>] kmem_cache_alloc_trace+0x16d/0x360
> [<0000000051803c95>] pinctrl_init_controller+0x6ed/0xb70
> [<0000000064346707>] pinctrl_register+0x27/0x80
> [<0000000029b0e186>] devm_pinctrl_register+0x5b/0xe0
> [<00000000391f5a3e>] mcp23s08_probe_one+0x968/0x118a [pinctrl_mcp23s08]
> [<000000006112c039>] mcp230xx_probe+0x266/0x560 [pinctrl_mcp23s08_i2c]
>
> If pinctrl_claim_hogs() fails, the 'pindesc' allocated in pinctrl_register_one_pin()
> need be freed.
>
> Reported-by: Hulk Robot <hulkci@...wei.com>
> Fixes: 950b0d91dc10 ("pinctrl: core: Fix regression caused by delayed work for hogs")
> Signed-off-by: Yang Yingliang <yangyingliang@...wei.com>
Excellent find and fix!
Thanks so much Yang!
Patch applied and tagged for stable.
Yours,
Linus Walleij
Powered by blists - more mailing lists