mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] usb: gadget: lpc32xx_udc: Cocci spatch "memdup.spatch"
@ 2013-06-01  9:36 Thomas Meyer
  2013-06-01 16:58 ` Felipe Balbi
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Meyer @ 2013-06-01  9:36 UTC (permalink / raw)
  To: balbi, grant.likely, rob.herring, linux-usb, linux-kernel


Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
---

diff -u -p a/drivers/usb/gadget/lpc32xx_udc.c b/drivers/usb/gadget/lpc32xx_udc.c
--- a/drivers/usb/gadget/lpc32xx_udc.c
+++ b/drivers/usb/gadget/lpc32xx_udc.c
@@ -3046,11 +3046,10 @@ static int __init lpc32xx_udc_probe(stru
 	dma_addr_t dma_handle;
 	struct device_node *isp1301_node;
 
-	udc = kzalloc(sizeof(*udc), GFP_KERNEL);
+	udc = kmemdup(&controller_template, sizeof(*udc), GFP_KERNEL);
 	if (!udc)
 		return -ENOMEM;
 
-	memcpy(udc, &controller_template, sizeof(*udc));
 	for (i = 0; i <= 15; i++)
 		udc->ep[i].udc = udc;
 	udc->gadget.ep0 = &udc->ep[0].ep;



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-06-01 17:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-01  9:36 [PATCH] usb: gadget: lpc32xx_udc: Cocci spatch "memdup.spatch" Thomas Meyer
2013-06-01 16:58 ` Felipe Balbi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome