[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220507114516.5de49b46cf5349db7121eff8@linux-foundation.org>
Date: Sat, 7 May 2022 11:45:16 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: Puyou Lu <puyou.lu@...il.com>
Cc: Andy Shevchenko <andy@...nel.org>,
Kees Cook <keescook@...omium.org>,
Petr Mladek <pmladek@...e.com>,
Linus Walleij <linus.walleij@...aro.org>,
Guenter Roeck <linux@...ck-us.net>,
Chris Down <chris@...isdown.name>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] lib/string_helpers: fix not adding strarray to
device's resource list.
On Fri, 6 May 2022 15:36:22 +0800 Puyou Lu <puyou.lu@...il.com> wrote:
> Add allocated strarray to device's resource list. This is a must to
> automatically release strarray when the device disappears.
So at present we have a memory leak?
Is this likely to be serious enough to justify backporting the fix into
-stable kernels?
> --- a/lib/string_helpers.c
> +++ b/lib/string_helpers.c
> @@ -757,6 +757,9 @@ char **devm_kasprintf_strarray(struct device *dev, const char *prefix, size_t n)
> return ERR_PTR(-ENOMEM);
> }
>
> + ptr->n = n;
> + devres_add(dev, ptr);
> +
> return ptr->array;
> }
> EXPORT_SYMBOL_GPL(devm_kasprintf_strarray);
Powered by blists - more mailing lists