All of lore.kernel.org
 help / color / mirror / Atom feed
From: gregkh@linuxfoundation.org (Greg Kroah-Hartman)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] staging: bcm2835-audio: Disconnect and free vchi_instance on module_exit()
Date: Mon, 23 Apr 2018 15:50:24 +0200	[thread overview]
Message-ID: <20180423135024.GA2337@kroah.com> (raw)
In-Reply-To: <20180417050028.19372-1-k.marinushkin@gmail.com>

On Tue, Apr 17, 2018 at 07:00:28AM +0200, Kirill Marinushkin wrote:
> In the current implementation, vchi_instance is inited during the first
> call of bcm2835_audio_open_connection(), and is never freed. It causes a
> memory leak when the module `snd_bcm2835` is removed.
> 
> Here is how this commit fixes it:
> 
> * the VCHI context (including vchi_instance) is created once in the
>   platform's devres
> * the VCHI context is allocated and connected once during module_init()
> * all created bcm2835_chips have a pointer to this VCHI context
> * bcm2835_audio_open_connection() can access the VCHI context through the
>   associated bcm2835_chip
> * the VCHI context is disconnected and freed once during module_exit()
> 
> After this commit is applied, I don't see other issues with the module's
> init/exit, so I also remove the associated TODO task.
> 
> Steps to reproduce the memory leak before this commit:

<snip>

Patch dropped due to kbuild complaints.

Please fix up and resend.

thanks,

greg k-h

WARNING: multiple messages have this Message-ID (diff)
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Kirill Marinushkin <k.marinushkin@gmail.com>
Cc: Stefan Wahren <stefan.wahren@i2se.com>,
	devel@driverdev.osuosl.org,
	Florian Fainelli <f.fainelli@gmail.com>,
	Scott Branden <sbranden@broadcom.com>,
	Ray Jui <rjui@broadcom.com>,
	linux-kernel@vger.kernel.org, Eric Anholt <eric@anholt.net>,
	Andy Shevchenko <andy.shevchenko@gmail.com>,
	bcm-kernel-feedback-list@broadcom.com,
	linux-rpi-kernel@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] staging: bcm2835-audio: Disconnect and free vchi_instance on module_exit()
Date: Mon, 23 Apr 2018 15:50:24 +0200	[thread overview]
Message-ID: <20180423135024.GA2337@kroah.com> (raw)
In-Reply-To: <20180417050028.19372-1-k.marinushkin@gmail.com>

On Tue, Apr 17, 2018 at 07:00:28AM +0200, Kirill Marinushkin wrote:
> In the current implementation, vchi_instance is inited during the first
> call of bcm2835_audio_open_connection(), and is never freed. It causes a
> memory leak when the module `snd_bcm2835` is removed.
> 
> Here is how this commit fixes it:
> 
> * the VCHI context (including vchi_instance) is created once in the
>   platform's devres
> * the VCHI context is allocated and connected once during module_init()
> * all created bcm2835_chips have a pointer to this VCHI context
> * bcm2835_audio_open_connection() can access the VCHI context through the
>   associated bcm2835_chip
> * the VCHI context is disconnected and freed once during module_exit()
> 
> After this commit is applied, I don't see other issues with the module's
> init/exit, so I also remove the associated TODO task.
> 
> Steps to reproduce the memory leak before this commit:

<snip>

Patch dropped due to kbuild complaints.

Please fix up and resend.

thanks,

greg k-h
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

  parent reply	other threads:[~2018-04-23 13:50 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-17  5:00 [PATCH] staging: bcm2835-audio: Disconnect and free vchi_instance on module_exit() Kirill Marinushkin
2018-04-17  5:00 ` Kirill Marinushkin
2018-04-17 19:56 ` kbuild test robot
2018-04-17 19:56   ` kbuild test robot
2018-04-23 13:50 ` Greg Kroah-Hartman [this message]
2018-04-23 13:50   ` Greg Kroah-Hartman
2018-04-24  0:35   ` Kirill Marinushkin
2018-04-24  0:35     ` Kirill Marinushkin
2018-04-24  7:16     ` Greg Kroah-Hartman
2018-04-24  7:16       ` Greg Kroah-Hartman
2018-04-24  7:44       ` [RESEND PATCH] " Kirill Marinushkin
2018-04-24  7:44         ` Kirill Marinushkin
2018-04-24 11:50         ` Dan Carpenter
2018-04-24 11:50           ` Dan Carpenter
2018-04-24 16:24         ` Andy Shevchenko
2018-04-24 16:24           ` Andy Shevchenko
2018-04-24 18:27         ` Kirill Marinushkin
2018-04-24 18:27           ` Kirill Marinushkin
2018-04-24 18:35           ` Andy Shevchenko
2018-04-24 18:35             ` Andy Shevchenko
2018-04-24 18:51             ` Kirill Marinushkin
2018-04-24 18:51               ` Kirill Marinushkin
2018-04-25  6:16               ` Greg Kroah-Hartman
2018-04-25  6:16                 ` Greg Kroah-Hartman
2018-04-24 19:57           ` [PATCH v2] " Kirill Marinushkin
2018-04-24 19:57             ` Kirill Marinushkin
2018-04-25  6:16             ` Greg Kroah-Hartman
2018-04-25  6:16               ` Greg Kroah-Hartman
2018-04-25 17:35               ` Kirill Marinushkin
2018-04-25 17:35                 ` Kirill Marinushkin
2018-04-26  5:38                 ` Dan Carpenter
2018-04-26  5:38                   ` Dan Carpenter
2018-04-26 17:34               ` [PATCH v3] " Kirill Marinushkin
2018-04-26 17:34                 ` Kirill Marinushkin
2018-04-24  8:14     ` [PATCH] " Stefan Wahren
2018-04-24  8:14       ` Stefan Wahren

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=20180423135024.GA2337@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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.