diff options
Diffstat (limited to 'drivers/net/usb/dm9601.c')
-rw-r--r-- | drivers/net/usb/dm9601.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/net/usb/dm9601.c b/drivers/net/usb/dm9601.c index 47634b617107..02b622e3b9fb 100644 --- a/drivers/net/usb/dm9601.c +++ b/drivers/net/usb/dm9601.c | |||
@@ -93,10 +93,9 @@ static int dm_write(struct usbnet *dev, u8 reg, u16 length, void *data) | |||
93 | netdev_dbg(dev->net, "dm_write() reg=0x%02x, length=%d\n", reg, length); | 93 | netdev_dbg(dev->net, "dm_write() reg=0x%02x, length=%d\n", reg, length); |
94 | 94 | ||
95 | if (data) { | 95 | if (data) { |
96 | buf = kmalloc(length, GFP_KERNEL); | 96 | buf = kmemdup(data, length, GFP_KERNEL); |
97 | if (!buf) | 97 | if (!buf) |
98 | goto out; | 98 | goto out; |
99 | memcpy(buf, data, length); | ||
100 | } | 99 | } |
101 | 100 | ||
102 | err = usb_control_msg(dev->udev, | 101 | err = usb_control_msg(dev->udev, |