diff options
author | Julia Lawall <julia@diku.dk> | 2010-05-19 19:11:14 +0200 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2010-05-19 19:14:31 +0200 |
commit | 641d446f89314d19fe17fcb9f19659a09fabe418 (patch) | |
tree | 8b1209478ba054dc939c7cf690d899c0c7ecbcc6 /drivers/input/touchscreen/usbtouchscreen.c | |
parent | Input: do not force selecting i8042 on Moorestown (diff) | |
download | linux-641d446f89314d19fe17fcb9f19659a09fabe418.tar.xz linux-641d446f89314d19fe17fcb9f19659a09fabe418.zip |
Input: usbtouchscreen - switch to using kmemdup()
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>
Diffstat (limited to 'drivers/input/touchscreen/usbtouchscreen.c')
-rw-r--r-- | drivers/input/touchscreen/usbtouchscreen.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/input/touchscreen/usbtouchscreen.c b/drivers/input/touchscreen/usbtouchscreen.c index 99330bbdbac7..0b0ae2e17a60 100644 --- a/drivers/input/touchscreen/usbtouchscreen.c +++ b/drivers/input/touchscreen/usbtouchscreen.c @@ -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__); |