@@ -153,10 +153,9 @@ static int pn533_usb_send_ack(struct pn5
char *buffer;
int rc;
- buffer = kmalloc(sizeof(ack), GFP_KERNEL);
+ buffer = kmemdup(ack, sizeof(ack), GFP_KERNEL);
if (!buffer)
return -ENOMEM;
- memcpy(buffer, ack, sizeof(ack));
phy->out_urb->transfer_buffer = (u8 *)ack;
phy->out_urb->transfer_buffer_length = sizeof(ack);
@@ -390,10 +389,9 @@ static int pn533_acr122_poweron_rdr(stru
dev_dbg(&phy->udev->dev, "%s\n", __func__);
- buffer = kmalloc(sizeof(cmd), GFP_KERNEL);
+ buffer = kmemdup(cmd, sizeof(cmd), GFP_KERNEL);
if (!buffer)
return -ENOMEM;
- memcpy(buffer, cmd, sizeof(cmd));
init_completion(&arg.done);
cntx = phy->in_urb->context; /* backup context */