]> Pileus Git - ~andy/linux/blobdiff - arch/mips/ath79/dev-leds-gpio.c
Merge branch 'kvm-arm/vgic-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git...
[~andy/linux] / arch / mips / ath79 / dev-leds-gpio.c
index cdade68dcd17a311d76af069c24e714d4aa690b6..dcb1debcefb8f81065ee48f7a7ceaa57fd16e6bb 100644 (file)
@@ -24,12 +24,10 @@ void __init ath79_register_leds_gpio(int id,
        struct gpio_led *p;
        int err;
 
-       p = kmalloc(num_leds * sizeof(*p), GFP_KERNEL);
+       p = kmemdup(leds, num_leds * sizeof(*p), GFP_KERNEL);
        if (!p)
                return;
 
-       memcpy(p, leds, num_leds * sizeof(*p));
-
        pdev = platform_device_alloc("leds-gpio", id);
        if (!pdev)
                goto err_free_leds;