Linux Hardware Monitor development
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Jean Delvare <jdelvare@suse.com>,
	linux-hwmon@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] hwmon: (acpi_power_meter) clean up freeing code
Date: Fri, 16 Oct 2020 18:25:45 -0700	[thread overview]
Message-ID: <20201017012545.GA195203@roeck-us.net> (raw)
In-Reply-To: <20201007075148.GB2529578@mwanda>

On Wed, Oct 07, 2020 at 10:51:48AM +0300, Dan Carpenter wrote:
> This code works okay but Smatch flagged it as a double free.  I've
> changed three things to make it more clear.  1)  Remove the call to
> free_capabilities() in acpi_power_meter_add().  This call is a no-op
> because the capabilities have not been allocated yet.  2)  Set "*str" to
> NULL in free_capabilities() so that way the function can be called twice
> in a row without leading to a double free.  3)  Call free_capabilities()
> in read_capabilities() instead of open coding the free.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Hmm, somehow this patch slipped throigh the cracks.
Sorry for that. Applied.

Thanks,
Guenter

      reply	other threads:[~2020-10-17  6:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-07  7:51 [PATCH] hwmon: (acpi_power_meter) clean up freeing code Dan Carpenter
2020-10-17  1:25 ` Guenter Roeck [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=20201017012545.GA195203@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=dan.carpenter@oracle.com \
    --cc=jdelvare@suse.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-hwmon@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox