Commit 641d446f authored by Julia Lawall's avatar Julia Lawall Committed by Dmitry Torokhov

Input: usbtouchscreen - switch to using kmemdup()

Use kmemdup when some other buffer is immediately copied into the
allocated region.
Signed-off-by: default avatarJulia Lawall <julia@diku.dk>
Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
parent 685afae0
...@@ -811,12 +811,11 @@ static int nexio_init(struct usbtouch_usb *usbtouch) ...@@ -811,12 +811,11 @@ static int nexio_init(struct usbtouch_usb *usbtouch)
priv = usbtouch->priv; 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) if (!priv->ack_buf)
goto err_priv; goto err_priv;
memcpy(priv->ack_buf, nexio_ack_pkt, sizeof(nexio_ack_pkt));
priv->ack = usb_alloc_urb(0, GFP_KERNEL); priv->ack = usb_alloc_urb(0, GFP_KERNEL);
if (!priv->ack) { if (!priv->ack) {
dbg("%s - usb_alloc_urb failed: usbtouch->ack", __func__); dbg("%s - usb_alloc_urb failed: usbtouch->ack", __func__);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment