lkml.org 
[lkml]   [2015]   [Jul]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.1 208/267] ACPI / LPSS: Fix up acpi_lpss_create_device()
    Date
    4.1-stable review patch.  If anyone has any objections, please let me know.

    ------------------

    From: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>

    commit d3e13ff3c1aa2403d9a5f371baac088daeb8f56d upstream.

    Fix a return value (which should be a negative error code) and a
    memory leak (the list allocated by acpi_dev_get_resources() needs
    to be freed on ioremap() errors too) in acpi_lpss_create_device()
    introduced by commit 4483d59e29fe 'ACPI / LPSS: check the result
    of ioremap()'.

    Fixes: 4483d59e29fe 'ACPI / LPSS: check the result of ioremap()'
    Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    ---
    drivers/acpi/acpi_lpss.c | 7 +++++--
    1 file changed, 5 insertions(+), 2 deletions(-)

    --- a/drivers/acpi/acpi_lpss.c
    +++ b/drivers/acpi/acpi_lpss.c
    @@ -352,13 +352,16 @@ static int acpi_lpss_create_device(struc
    pdata->mmio_size = resource_size(rentry->res);
    pdata->mmio_base = ioremap(rentry->res->start,
    pdata->mmio_size);
    - if (!pdata->mmio_base)
    - goto err_out;
    break;
    }

    acpi_dev_free_resource_list(&resource_list);

    + if (!pdata->mmio_base) {
    + ret = -ENOMEM;
    + goto err_out;
    + }
    +
    pdata->dev_desc = dev_desc;

    if (dev_desc->setup)



    \
     
     \ /
      Last update: 2015-07-31 22:21    [W:4.049 / U:0.076 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site