Skip to content

Commit

Permalink
Input: usbtouchscreen - switch to using kmemdup()
Browse files Browse the repository at this point in the history
Use kmemdup when some other buffer is immediately copied into the
allocated region.

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
  • Loading branch information
Julia Lawall authored and Dmitry Torokhov committed May 19, 2010
1 parent 685afae commit 641d446
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/input/touchscreen/usbtouchscreen.c
Original file line number Diff line number Diff line change
Expand Up @@ -811,12 +811,11 @@ static int nexio_init(struct usbtouch_usb *usbtouch)

priv = usbtouch->priv;

priv->ack_buf = kmalloc(sizeof(nexio_ack_pkt), GFP_KERNEL);
priv->ack_buf = kmemdup(nexio_ack_pkt, sizeof(nexio_ack_pkt),
GFP_KERNEL);
if (!priv->ack_buf)
goto err_priv;

memcpy(priv->ack_buf, nexio_ack_pkt, sizeof(nexio_ack_pkt));

priv->ack = usb_alloc_urb(0, GFP_KERNEL);
if (!priv->ack) {
dbg("%s - usb_alloc_urb failed: usbtouch->ack", __func__);
Expand Down

0 comments on commit 641d446

Please sign in to comment.