public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
To: ykzhao <yakui.zhao@intel.com>
Cc: "Zhang, Rui" <rui.zhang@intel.com>,
	linux acpi <linux-acpi@vger.kernel.org>
Subject: Re: [PATCH] ACPI fan: fix memleak on acpi_fan_add_fs() failure
Date: Mon, 14 Sep 2009 08:49:30 +0100	[thread overview]
Message-ID: <4AADF58A.4070109@tuffmail.co.uk> (raw)
In-Reply-To: <1252890570.3609.229.camel@localhost.localdomain>

ykzhao wrote:
> On Sun, 2009-09-13 at 18:28 +0800, Alan Jenkins wrote:
>   
>> Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
>>     
> It sounds reasonable although we don't fail in calling the function of
> acpi_fan_add_fs.
>   

Agreed, this applies to ENOMEM or other weird internal errors only.

>> ---
>>  drivers/acpi/fan.c |    8 ++++++--
>>  1 files changed, 6 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/acpi/fan.c b/drivers/acpi/fan.c
>> index 947556e..eb1511e 100644
>> --- a/drivers/acpi/fan.c
>> +++ b/drivers/acpi/fan.c
>> @@ -283,13 +283,17 @@ static int acpi_fan_add(struct acpi_device *device)
>>  
>>  	result = acpi_fan_add_fs(device);
>>  	if (result)
>> -		goto end;
>> +		goto unregister;
>>  
>>  	printk(KERN_INFO PREFIX "%s [%s] (%s)\n",
>>  	       acpi_device_name(device), acpi_device_bid(device),
>>  	       !device->power.state ? "on" : "off");
>>     
>
> At the same time we should return directly if the result is zero. 
> But in this patch it seems that it will also remove the sysfs I/F link
> when the result is zero.
>
> Thanks.
>   

Eek, thanks for pointing this out.  I'll send a fixed version
Alan

      reply	other threads:[~2009-09-14  7:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-13 10:28 [PATCH] ACPI fan: fix memleak on acpi_fan_add_fs() failure Alan Jenkins
2009-09-14  1:09 ` ykzhao
2009-09-14  7:49   ` Alan Jenkins [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=4AADF58A.4070109@tuffmail.co.uk \
    --to=alan-jenkins@tuffmail.co.uk \
    --cc=linux-acpi@vger.kernel.org \
    --cc=rui.zhang@intel.com \
    --cc=yakui.zhao@intel.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