Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux...
[firefly-linux-kernel-4.4.55.git] / drivers / parport / parport_sunbpp.c
index 5c4b6a1db6cad94e078d0a60489832b265fc5fea..dffd6d0bd15b7795ec1a1d796b5652e8c540944c 100644 (file)
@@ -284,12 +284,11 @@ static int bpp_probe(struct platform_device *op)
        size = resource_size(&op->resource[0]);
        dma = PARPORT_DMA_NONE;
 
-       ops = kmalloc(sizeof(struct parport_operations), GFP_KERNEL);
+       ops = kmemdup(&parport_sunbpp_ops, sizeof(struct parport_operations),
+                     GFP_KERNEL);
         if (!ops)
                goto out_unmap;
 
-        memcpy (ops, &parport_sunbpp_ops, sizeof(struct parport_operations));
-
        dprintk(("register_port\n"));
        if (!(p = parport_register_port((unsigned long)base, irq, dma, ops)))
                goto out_free_ops;