Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 Sep 2025 15:24:20 -0600
From:      Warner Losh <imp@bsdimp.com>
To:        John Baldwin <jhb@freebsd.org>
Cc:        Warner Losh <imp@freebsd.org>, src-committers@freebsd.org,  dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org
Subject:   Re: git: a930cc8bad64 - main - GEOM_UNION: Should free sc in g_union_ctl_create when error happened.
Message-ID:  <CANCZdfocVksYfMSFA7xnZDnVu_9HshznmKK_q7z61rG=ousgjQ@mail.gmail.com>
In-Reply-To: <e5aa0f41-3926-40f6-938b-4e433e9528ca@FreeBSD.org>
References:  <202509051842.585IgHAr096237@gitrepo.freebsd.org> <e5aa0f41-3926-40f6-938b-4e433e9528ca@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
On Fri, Sep 5, 2025 at 1:37 PM John Baldwin <jhb@freebsd.org> wrote:

> On 9/5/25 14:42, Warner Losh wrote:
> > The branch main has been updated by imp:
> >
> > URL:
> https://cgit.FreeBSD.org/src/commit/?id=a930cc8bad644039cfcfa5ff7c6fe3e8548aa9ae
> >
> > commit a930cc8bad644039cfcfa5ff7c6fe3e8548aa9ae
> > Author:     Wuyang Chung <wy-chung@outlook.com>
> > AuthorDate: 2025-09-02 06:23:26 +0000
> > Commit:     Warner Losh <imp@FreeBSD.org>
> > CommitDate: 2025-09-05 18:42:20 +0000
> >
> >      GEOM_UNION: Should free sc in g_union_ctl_create when error
> happened.
> >
> >      Signed-off-by: Wuyang Chung <wy-chung@outlook.com>
> >      Reviewed by: imp
> >      Pull Request: https://github.com/freebsd/freebsd-src/pull/1835
> > ---
> >   sys/geom/union/g_union.c | 1 +
> >   1 file changed, 1 insertion(+)
> >
> > diff --git a/sys/geom/union/g_union.c b/sys/geom/union/g_union.c
> > index 9734fc1bcfe3..0701e76db671 100644
> > --- a/sys/geom/union/g_union.c
> > +++ b/sys/geom/union/g_union.c
> > @@ -358,6 +358,7 @@ fail2:
> >   fail1:
> >       g_destroy_consumer(lowercp);
> >       g_destroy_provider(newpp);
> > +     g_free(sc);
> >       g_destroy_geom(gp);
> >   }
>
> Hmm, as markj@ noted in the review, this also needs an `rw_destroy`.
>

Fixed in 43b8c4e451196c5a5014679cf6e5d459bf330928. Thanks for the reminder.

Warner

[-- Attachment #2 --]
<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Fri, Sep 5, 2025 at 1:37 PM John Baldwin &lt;<a href="mailto:jhb@freebsd.org">jhb@freebsd.org</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 9/5/25 14:42, Warner Losh wrote:<br>
&gt; The branch main has been updated by imp:<br>
&gt; <br>
&gt; URL: <a href="https://cgit.FreeBSD.org/src/commit/?id=a930cc8bad644039cfcfa5ff7c6fe3e8548aa9ae" rel="noreferrer" target="_blank">https://cgit.FreeBSD.org/src/commit/?id=a930cc8bad644039cfcfa5ff7c6fe3e8548aa9ae</a><br>;
&gt; <br>
&gt; commit a930cc8bad644039cfcfa5ff7c6fe3e8548aa9ae<br>
&gt; Author:     Wuyang Chung &lt;<a href="mailto:wy-chung@outlook.com" target="_blank">wy-chung@outlook.com</a>&gt;<br>
&gt; AuthorDate: 2025-09-02 06:23:26 +0000<br>
&gt; Commit:     Warner Losh &lt;imp@FreeBSD.org&gt;<br>
&gt; CommitDate: 2025-09-05 18:42:20 +0000<br>
&gt; <br>
&gt;      GEOM_UNION: Should free sc in g_union_ctl_create when error happened.<br>
&gt;      <br>
&gt;      Signed-off-by: Wuyang Chung &lt;<a href="mailto:wy-chung@outlook.com" target="_blank">wy-chung@outlook.com</a>&gt;<br>
&gt;      Reviewed by: imp<br>
&gt;      Pull Request: <a href="https://github.com/freebsd/freebsd-src/pull/1835" rel="noreferrer" target="_blank">https://github.com/freebsd/freebsd-src/pull/1835</a><br>;
&gt; ---<br>
&gt;   sys/geom/union/g_union.c | 1 +<br>
&gt;   1 file changed, 1 insertion(+)<br>
&gt; <br>
&gt; diff --git a/sys/geom/union/g_union.c b/sys/geom/union/g_union.c<br>
&gt; index 9734fc1bcfe3..0701e76db671 100644<br>
&gt; --- a/sys/geom/union/g_union.c<br>
&gt; +++ b/sys/geom/union/g_union.c<br>
&gt; @@ -358,6 +358,7 @@ fail2:<br>
&gt;   fail1:<br>
&gt;       g_destroy_consumer(lowercp);<br>
&gt;       g_destroy_provider(newpp);<br>
&gt; +     g_free(sc);<br>
&gt;       g_destroy_geom(gp);<br>
&gt;   }<br>
<br>
Hmm, as markj@ noted in the review, this also needs an `rw_destroy`.<br></blockquote><div><br></div><div>Fixed in 43b8c4e451196c5a5014679cf6e5d459bf330928. Thanks for the reminder.</div><div><br></div><div>Warner </div></div></div>

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfocVksYfMSFA7xnZDnVu_9HshznmKK_q7z61rG=ousgjQ>