All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: Puyou Lu <puyou.lu@gmail.com>
Cc: akpm@linux-foundation.org, andy@kernel.org, chris@chrisdown.name,
	keescook@chromium.org, linus.walleij@linaro.org,
	linux-kernel@vger.kernel.org, linux@roeck-us.net,
	pmladek@suse.com
Subject: Re: [PATCH] lib/string_helpers: add allocated strarray to device's resource list.
Date: Fri, 6 May 2022 08:43:24 +0200	[thread overview]
Message-ID: <CAHp75VfJoiAW+rMcDawFdaSZrNhjjnFF9j94B=1mDKLSeMNYBw@mail.gmail.com> (raw)
In-Reply-To: <20220506044409.30066-1-puyou.lu@gmail.com>

On Fri, May 6, 2022 at 6:44 AM Puyou Lu <puyou.lu@gmail.com> wrote:
>
> This is a must to automatically release strarray when the device
> disappears.

Thanks for your patch!

First of all, since this is a v2 of it, you need to update the subject
to reflect this and add a changelog after the cutter '--- ' line
below.
Second, because this is the fix, please add a Fixes tag.

> Signed-off-by: Puyou Lu <puyou.lu@gmail.com>
> ---
>  lib/string_helpers.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/lib/string_helpers.c b/lib/string_helpers.c
> index 4f877e9551d5..5ed3beb066e6 100644
> --- 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);

The code seems correct, good catch!

>         return ptr->array;
>  }
>  EXPORT_SYMBOL_GPL(devm_kasprintf_strarray);
> --
> 2.17.1
>


-- 
With Best Regards,
Andy Shevchenko

  reply	other threads:[~2022-05-06  6:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-06  2:28 [PATCH] lib/string_helpers: add allocated strarray to device resource Puyou Lu
2022-05-06  3:23 ` [PATCH] lib/string_helpers: add allocated strarray to device Puyou Lu
2022-05-06  4:44   ` [PATCH] lib/string_helpers: add allocated strarray to device's resource list Puyou Lu
2022-05-06  6:43     ` Andy Shevchenko [this message]
2022-05-12 20:49 ` [PATCH] lib/string_helpers: add allocated strarray to device resource 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='CAHp75VfJoiAW+rMcDawFdaSZrNhjjnFF9j94B=1mDKLSeMNYBw@mail.gmail.com' \
    --to=andy.shevchenko@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=andy@kernel.org \
    --cc=chris@chrisdown.name \
    --cc=keescook@chromium.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=pmladek@suse.com \
    --cc=puyou.lu@gmail.com \
    /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.