public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Arjun Sreedharan <arjun024@gmail.com>
Cc: lenb@kernel.org, linux-acpi@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] PNPACPI: check return value of pnpacpi_parse_allocated_resource() and pnpacpi_parse_resource_option_data()
Date: Wed, 23 Jul 2014 00:12:03 +0200	[thread overview]
Message-ID: <6018343.yi13pxNXUP@vostro.rjw.lan> (raw)
In-Reply-To: <1406056419-3047-1-git-send-email-arjun024@gmail.com>

On Wednesday, July 23, 2014 12:43:39 AM Arjun Sreedharan wrote:
> Handle error condition since pnpacpi_parse_allocated_resource() and pnpacpi_parse_resource_option_data() could return -EPERM.
> 
> Signed-off-by: Arjun Sreedharan <arjun024@gmail.com>

I wonder if this fixes any functional issue you've seen or someone has
reported to you or it's just an "Oh, we probably should handle the return
values here" kind of thing?

> ---
>  drivers/pnp/pnpacpi/core.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/pnp/pnpacpi/core.c b/drivers/pnp/pnpacpi/core.c
> index b81448b..c3214e9 100644
> --- a/drivers/pnp/pnpacpi/core.c
> +++ b/drivers/pnp/pnpacpi/core.c
> @@ -272,10 +272,14 @@ static int __init pnpacpi_add_device(struct acpi_device *device)
>  		strncpy(dev->name, acpi_device_bid(device), sizeof(dev->name));
>  
>  	if (dev->active)
> -		pnpacpi_parse_allocated_resource(dev);
> +		error = pnpacpi_parse_allocated_resource(dev);
> +		if (error)
> +			return error;
>  
>  	if (dev->capabilities & PNP_CONFIGURABLE)
> -		pnpacpi_parse_resource_option_data(dev);
> +		error = pnpacpi_parse_resource_option_data(dev);
> +		if (error)
> +			return error;
>  
>  	list_for_each_entry(id, &device->pnp.ids, list) {
>  		if (!strcmp(id->id, pnpid))
> 

-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

  reply	other threads:[~2014-07-22 21:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-22 19:13 [PATCH] PNPACPI: check return value of pnpacpi_parse_allocated_resource() and pnpacpi_parse_resource_option_data() Arjun Sreedharan
2014-07-22 22:12 ` Rafael J. Wysocki [this message]
2014-07-23  8:26   ` Arjun
2014-07-23 11:36     ` Rafael J. Wysocki
2014-07-23 19:49       ` Arjun Sreedharan

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=6018343.yi13pxNXUP@vostro.rjw.lan \
    --to=rjw@rjwysocki.net \
    --cc=arjun024@gmail.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@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