From: Alison Schofield <alison.schofield@intel.com>
To: Dan Williams <dan.j.williams@intel.com>
Cc: vishal.l.verma@intel.com, linux-cxl@vger.kernel.org
Subject: Re: [PATCH 1/2] cxl/region: Fix memdev_filter_pos() memory leak
Date: Thu, 15 Dec 2022 20:08:15 -0800 [thread overview]
Message-ID: <Y5vvLwgrafOGk7Jd@aschofie-mobl2> (raw)
In-Reply-To: <167106803234.1326377.5020851858779774338.stgit@dwillia2-xfh.jf.intel.com>
On Wed, Dec 14, 2022 at 05:33:52PM -0800, Dan Williams wrote:
> Arrange to free the temporary duplicate of @_csv in all exit paths. Just
> share a common exit path.
>
Reviewed-by: Alison Schofield <alison.schofield@intel.com>
> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
> ---
> cxl/region.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/cxl/region.c b/cxl/region.c
> index 15cac64a158c..2202afa440ef 100644
> --- a/cxl/region.c
> +++ b/cxl/region.c
> @@ -183,7 +183,7 @@ static int memdev_filter_pos(struct json_object *jobj, const char *_csv)
> for (pos = 0, arg = strtok_r(csv, which_sep(csv), &save); arg;
> arg = strtok_r(NULL, which_sep(csv), &save), pos++)
> if (util_cxl_memdev_filter(memdev, arg, NULL))
> - return pos;
> + break;
> free(csv);
>
> return pos;
>
next prev parent reply other threads:[~2022-12-16 4:08 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-15 1:33 [PATCH 0/2] cxl/region: Fix a couple memory safety bugs Dan Williams
2022-12-15 1:33 ` [PATCH 1/2] cxl/region: Fix memdev_filter_pos() memory leak Dan Williams
2022-12-16 4:08 ` Alison Schofield [this message]
2022-12-15 1:33 ` [PATCH 2/2] cxl/region: Fix memdev_filter_pos() separator detection Dan Williams
2022-12-16 4:06 ` Alison Schofield
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=Y5vvLwgrafOGk7Jd@aschofie-mobl2 \
--to=alison.schofield@intel.com \
--cc=dan.j.williams@intel.com \
--cc=linux-cxl@vger.kernel.org \
--cc=vishal.l.verma@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox