public inbox for linux-hwmon@vger.kernel.org
 help / color / mirror / Atom feed
From: "Martin K. Petersen" <martin.petersen@oracle.com>
To: Guenter Roeck <linux@roeck-us.net>
Cc: Hardware Monitoring <linux-hwmon@vger.kernel.org>,
	"Martin K . Petersen" <martin.petersen@oracle.com>,
	Jean Delvare <jdelvare@suse.com>
Subject: Re: [PATCH] hwmon: (core) Do not use device managed functions for memory allocations
Date: Fri, 17 Jan 2020 18:55:59 -0500	[thread overview]
Message-ID: <yq18sm5ljsg.fsf@oracle.com> (raw)
In-Reply-To: <20200117155624.24490-1-linux@roeck-us.net> (Guenter Roeck's message of "Fri, 17 Jan 2020 07:56:24 -0800")


Guenter,

> The hwmon core uses device managed functions, tied to the hwmon parent
> device, for various internal memory allocations. This is problematic
> since hwmon device lifetime does not necessarily match its parent's
> device lifetime. If there is a mismatch, memory leaks will accumulate
> until the parent device is released.
>
> Fix the problem by managing all memory allocations internally. The
> only exception is memory allocation for thermal device registration,
> which can be tied to the hwmon device, along with thermal device
> registration itself.

Great, this fixed the issue for me.

Tested-by: Martin K. Petersen <martin.petersen@oracle.com>

-- 
Martin K. Petersen	Oracle Linux Engineering

      reply	other threads:[~2020-01-17 23:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-17 15:56 [PATCH] hwmon: (core) Do not use device managed functions for memory allocations Guenter Roeck
2020-01-17 23:55 ` Martin K. Petersen [this message]

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=yq18sm5ljsg.fsf@oracle.com \
    --to=martin.petersen@oracle.com \
    --cc=jdelvare@suse.com \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux@roeck-us.net \
    /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