lkml.org 
[lkml]   [2010]   [Aug]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 09/28] Driver core: use kmemdup in platform_device_add_resources
    Date
    From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

    This makes platform_device_add_resources look like
    platform_device_add_data.

    Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    ---
    drivers/base/platform.c | 6 +++---
    1 files changed, 3 insertions(+), 3 deletions(-)

    diff --git a/drivers/base/platform.c b/drivers/base/platform.c
    index 4d99c8b..26eb69d 100644
    --- a/drivers/base/platform.c
    +++ b/drivers/base/platform.c
    @@ -191,13 +191,13 @@ int platform_device_add_resources(struct platform_device *pdev,
    {
    struct resource *r;

    - r = kmalloc(sizeof(struct resource) * num, GFP_KERNEL);
    + r = kmemdup(res, sizeof(struct resource) * num, GFP_KERNEL);
    if (r) {
    - memcpy(r, res, sizeof(struct resource) * num);
    pdev->resource = r;
    pdev->num_resources = num;
    + return 0;
    }
    - return r ? 0 : -ENOMEM;
    + return -ENOMEM;
    }
    EXPORT_SYMBOL_GPL(platform_device_add_resources);

    --
    1.7.2
    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2010-08-06 00:27    [W:0.030 / U:59.864 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site