提交 641d446f 编写于 作者: J Julia Lawall 提交者: Dmitry Torokhov

Input: usbtouchscreen - switch to using kmemdup()

Use kmemdup when some other buffer is immediately copied into the
allocated region.
Signed-off-by: NJulia Lawall <julia@diku.dk>
Signed-off-by: NDmitry Torokhov <dtor@mail.ru>
上级 685afae0
......@@ -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__);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册