linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Sven Van Asbroeck <thesven73@gmail.com>
Cc: "Sven Van Asbroeck" <svendev@arcx.com>,
	robh+dt@kernel.org, "Linus Walleij" <linus.walleij@linaro.org>,
	"Lee Jones" <lee.jones@linaro.org>,
	mark.rutland@arm.com, "Andreas Färber" <afaerber@suse.de>,
	treding@nvidia.com, "David Lechner" <david@lechnology.com>,
	noralf@tronnes.org, johan@kernel.org,
	"Michal Simek" <monstr@monstr.eu>,
	michal.vokac@ysoft.com, "Arnd Bergmann" <arnd@arndb.de>,
	john.garry@huawei.com, geert+renesas@glider.be,
	robin.murphy@arm.com,
	"Paul Gortmaker" <paul.gortmaker@windriver.com>,
	sebastien.bourdelin@savoirfairelinux.com, icenowy@aosc.io,
	"Stuart Yoder" <stuyoder@gmail.com>,
	maxime.ripard@bootlin.com,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v8 1/6] fieldbus_dev: add Fieldbus Device subsystem.
Date: Sat, 9 Feb 2019 10:11:42 +0100	[thread overview]
Message-ID: <20190209091142.GC3377@kroah.com> (raw)
In-Reply-To: <CAGngYiXjJtGNLAV_jvoj2NsjD+UCnK_Q+ZssgSwAukYAXdgE2A@mail.gmail.com>

On Fri, Feb 08, 2019 at 11:30:22AM -0500, Sven Van Asbroeck wrote:
> On Fri, Feb 8, 2019 at 7:18 AM Greg KH <gregkh@linuxfoundation.org> wrote:
> >
> > > +static DEFINE_IDA(fieldbus_ida);
> >
> > You forget to destroy this ida structure when the module is removed.
> > It's a common thing to get wrong :(
> >
> 
> But fieldbus_ida is allocated on the heap. So as long as calls to
> ida_simple_get() and ida_simple_remove() are matched, there
> should be no resource leak?
> 
> What am I missing?

the ida structure does some internal allocations and ida_destroy() has
to be called when your code is being removed to properly free it.

Again, it's not obvious at all, but it is needed :(

thanks,

greg k-h

  reply	other threads:[~2019-02-09  9:11 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-24 20:12 [PATCH v8 0/6] Add Fieldbus subsystem + support HMS Profinet card Sven Van Asbroeck
2019-01-24 20:12 ` [PATCH v8 1/6] fieldbus_dev: add Fieldbus Device subsystem Sven Van Asbroeck
2019-02-08 12:18   ` Greg KH
2019-02-08 16:30     ` Sven Van Asbroeck
2019-02-09  9:11       ` Greg KH [this message]
2019-01-24 20:12 ` [PATCH v8 2/6] anybus-s: support HMS Anybus-S bus Sven Van Asbroeck
2019-01-24 20:12 ` [PATCH v8 3/6] anybus-s: support the Arcx anybus controller Sven Van Asbroeck
2019-01-24 20:12 ` [PATCH v8 4/6] dt-bindings: anybus-controller: document devicetree binding Sven Van Asbroeck
2019-01-24 20:12 ` [PATCH v8 5/6] dt-bindings: Add vendor prefix for arcx / Archronix Sven Van Asbroeck
2019-01-24 20:12 ` [PATCH v8 6/6] fieldbus_dev: support HMS Profinet IRT industrial controller Sven Van Asbroeck
2019-02-08 12:19   ` Greg KH
2019-02-06 13:47 ` [PATCH v8 0/6] Add Fieldbus subsystem + support HMS Profinet card Sven Van Asbroeck
2019-02-08 12:19   ` Greg KH
2019-02-08 14:05     ` Sven Van Asbroeck
2019-02-08 14:14       ` Greg KH
2019-03-11 17:02         ` Sven Van Asbroeck
2019-03-11 17:25           ` Andreas Färber
2019-03-11 20:01             ` Sven Van Asbroeck
2019-03-11 19:13           ` Greg KH
2019-03-11 20:03             ` Sven Van Asbroeck
2019-03-12 17:11             ` Sven Van Asbroeck
2019-03-12 17:13               ` Greg KH

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=20190209091142.GC3377@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=afaerber@suse.de \
    --cc=arnd@arndb.de \
    --cc=david@lechnology.com \
    --cc=geert+renesas@glider.be \
    --cc=icenowy@aosc.io \
    --cc=johan@kernel.org \
    --cc=john.garry@huawei.com \
    --cc=lee.jones@linaro.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=maxime.ripard@bootlin.com \
    --cc=michal.vokac@ysoft.com \
    --cc=monstr@monstr.eu \
    --cc=noralf@tronnes.org \
    --cc=paul.gortmaker@windriver.com \
    --cc=robh+dt@kernel.org \
    --cc=robin.murphy@arm.com \
    --cc=sebastien.bourdelin@savoirfairelinux.com \
    --cc=stuyoder@gmail.com \
    --cc=svendev@arcx.com \
    --cc=thesven73@gmail.com \
    --cc=treding@nvidia.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;
as well as URLs for NNTP newsgroup(s).