lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4234415.npFyMyvrKf@vostro.rjw.lan>
Date:	Wed, 23 Jul 2014 13:36:31 +0200
From:	"Rafael J. Wysocki" <rjw@...ysocki.net>
To:	Arjun <arjun024@...il.com>
Cc:	Len Brown <lenb@...nel.org>, linux-acpi@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] PNPACPI: check return value of pnpacpi_parse_allocated_resource() and pnpacpi_parse_resource_option_data()

On Wednesday, July 23, 2014 01:56:36 PM Arjun wrote:
> ACPI 5.0 resource types like FixedDMA will fail pnpacpi_allocated_resource().
> pnpacpi_add_device() has to return error in that case.

Why?

> On 23 July 2014 03:42, Rafael J. Wysocki <rjw@...ysocki.net> wrote:
> > 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@...il.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.

-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ