Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 197442
b: refs/heads/master
c: 94002c0
h: refs/heads/master
v: v3
  • Loading branch information
Julia Lawall authored and Greg Kroah-Hartman committed May 17, 2010
1 parent c9d81f7 commit 82c1d99
Show file tree
Hide file tree
Showing 17 changed files with 30 additions and 46 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 96fe9ee2c2dfe3268961f3873ea6098b9b9f27c2
refs/heads/master: 94002c07ff0e207a883519ccc35c0b5390b29331
3 changes: 1 addition & 2 deletions trunk/drivers/staging/comedi/drivers/usbdux.c
Original file line number Diff line number Diff line change
Expand Up @@ -840,13 +840,12 @@ static int firmwareUpload(struct usbduxsub *usbduxsub,
}

/* we generate a local buffer for the firmware */
fwBuf = kzalloc(sizeFirmware, GFP_KERNEL);
fwBuf = kmemdup(firmwareBinary, sizeFirmware, GFP_KERNEL);
if (!fwBuf) {
dev_err(&usbduxsub->interface->dev,
"comedi_: mem alloc for firmware failed\n");
return -ENOMEM;
}
memcpy(fwBuf, firmwareBinary, sizeFirmware);

ret = usbduxsub_stop(usbduxsub);
if (ret < 0) {
Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/staging/comedi/drivers/usbduxfast.c
Original file line number Diff line number Diff line change
Expand Up @@ -1368,13 +1368,12 @@ static int firmwareUpload(struct usbduxfastsub_s *usbduxfastsub,
}

/* we generate a local buffer for the firmware */
fwBuf = kzalloc(sizeFirmware, GFP_KERNEL);
fwBuf = kmemdup(firmwareBinary, sizeFirmware, GFP_KERNEL);
if (!fwBuf) {
dev_err(&usbduxfastsub->interface->dev,
"comedi_: mem alloc for firmware failed\n");
return -ENOMEM;
}
memcpy(fwBuf, firmwareBinary, sizeFirmware);

ret = usbduxfastsub_stop(usbduxfastsub);
if (ret < 0) {
Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/staging/hv/vmbus.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,10 @@ static void VmbusOnMsgDPC(struct hv_driver *drv)
/* no msg */
break;
} else {
copied = kmalloc(sizeof(*copied), GFP_ATOMIC);
copied = kmemdup(msg, sizeof(*copied), GFP_ATOMIC);
if (copied == NULL)
continue;

memcpy(copied, msg, sizeof(*copied));
osd_schedule_callback(gVmbusConnection.WorkQueue,
VmbusOnChannelMessage,
(void *)copied);
Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/staging/line6/dumprequest.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,9 @@ int line6_wait_dump(struct line6_dump_request *l6dr, int nonblock)
int line6_dumpreq_initbuf(struct line6_dump_request *l6dr, const void *buf,
size_t len, int num)
{
l6dr->reqbufs[num].buffer = kmalloc(len, GFP_KERNEL);
l6dr->reqbufs[num].buffer = kmemdup(buf, len, GFP_KERNEL);
if (l6dr->reqbufs[num].buffer == NULL)
return -ENOMEM;
memcpy(l6dr->reqbufs[num].buffer, buf, len);
l6dr->reqbufs[num].length = len;
return 0;
}
Expand Down
6 changes: 2 additions & 4 deletions trunk/drivers/staging/line6/pod.c
Original file line number Diff line number Diff line change
Expand Up @@ -1074,7 +1074,8 @@ int pod_init(struct usb_interface *interface, struct usb_line6_pod *pod)
return -ENOMEM;
}

pod->buffer_versionreq = kmalloc(sizeof(pod_request_version),
pod->buffer_versionreq = kmemdup(pod_request_version,
sizeof(pod_request_version),
GFP_KERNEL);

if (pod->buffer_versionreq == NULL) {
Expand All @@ -1083,9 +1084,6 @@ int pod_init(struct usb_interface *interface, struct usb_line6_pod *pod)
return -ENOMEM;
}

memcpy(pod->buffer_versionreq, pod_request_version,
sizeof(pod_request_version));

/* create sysfs entries: */
err = pod_create_files2(&interface->dev);
if (err < 0) {
Expand Down
5 changes: 2 additions & 3 deletions trunk/drivers/staging/line6/variax.c
Original file line number Diff line number Diff line change
Expand Up @@ -486,16 +486,15 @@ int variax_init(struct usb_interface *interface,
return err;
}

variax->buffer_activate = kmalloc(sizeof(variax_activate), GFP_KERNEL);
variax->buffer_activate = kmemdup(variax_activate,
sizeof(variax_activate), GFP_KERNEL);

if (variax->buffer_activate == NULL) {
dev_err(&interface->dev, "Out of memory\n");
variax_destruct(interface);
return -ENOMEM;
}

memcpy(variax->buffer_activate, variax_activate,
sizeof(variax_activate));
init_timer(&variax->activate_timer);

/* create sysfs entries: */
Expand Down
16 changes: 6 additions & 10 deletions trunk/drivers/staging/pohmelfs/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,18 +204,18 @@ int pohmelfs_copy_crypto(struct pohmelfs_sb *psb)
}

if (g->hash_keysize) {
psb->hash_key = kmalloc(g->hash_keysize, GFP_KERNEL);
psb->hash_key = kmemdup(g->hash_key, g->hash_keysize,
GFP_KERNEL);
if (!psb->hash_key)
goto err_out_free_cipher_string;
memcpy(psb->hash_key, g->hash_key, g->hash_keysize);
psb->hash_keysize = g->hash_keysize;
}

if (g->cipher_keysize) {
psb->cipher_key = kmalloc(g->cipher_keysize, GFP_KERNEL);
psb->cipher_key = kmemdup(g->cipher_key, g->cipher_keysize,
GFP_KERNEL);
if (!psb->cipher_key)
goto err_out_free_hash;
memcpy(psb->cipher_key, g->cipher_key, g->cipher_keysize);
psb->cipher_keysize = g->cipher_keysize;
}

Expand Down Expand Up @@ -454,14 +454,12 @@ static int pohmelfs_crypto_hash_init(struct pohmelfs_config_group *g, struct poh
g->hash_strlen = c->strlen;
g->hash_keysize = c->keysize;

g->hash_key = kmalloc(c->keysize, GFP_KERNEL);
g->hash_key = kmemdup(key, c->keysize, GFP_KERNEL);
if (!g->hash_key) {
kfree(g->hash_string);
return -ENOMEM;
}

memcpy(g->hash_key, key, c->keysize);

return 0;
}

Expand All @@ -479,14 +477,12 @@ static int pohmelfs_crypto_cipher_init(struct pohmelfs_config_group *g, struct p
g->cipher_strlen = c->strlen;
g->cipher_keysize = c->keysize;

g->cipher_key = kmalloc(c->keysize, GFP_KERNEL);
g->cipher_key = kmemdup(key, c->keysize, GFP_KERNEL);
if (!g->cipher_key) {
kfree(g->cipher_string);
return -ENOMEM;
}

memcpy(g->cipher_key, key, c->keysize);

return 0;
}

Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c
Original file line number Diff line number Diff line change
Expand Up @@ -2667,11 +2667,11 @@ static int ieee80211_wpa_set_wpa_ie(struct ieee80211_device *ieee,
return -EINVAL;

if (param->u.wpa_ie.len) {
buf = kmalloc(param->u.wpa_ie.len, GFP_KERNEL);
buf = kmemdup(param->u.wpa_ie.data, param->u.wpa_ie.len,
GFP_KERNEL);
if (buf == NULL)
return -ENOMEM;

memcpy(buf, param->u.wpa_ie.data, param->u.wpa_ie.len);
kfree(ieee->wpa_ie);
ieee->wpa_ie = buf;
ieee->wpa_ie_len = param->u.wpa_ie.len;
Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/staging/rtl8187se/ieee80211/ieee80211_wx.c
Original file line number Diff line number Diff line change
Expand Up @@ -727,10 +727,9 @@ int ieee80211_wx_set_gen_ie(struct ieee80211_device *ieee, u8 *ie, size_t len)
printk("len:%zu, ie:%d\n", len, ie[1]);
return -EINVAL;
}
buf = kmalloc(len, GFP_KERNEL);
buf = kmemdup(ie, len, GFP_KERNEL);
if (buf == NULL)
return -ENOMEM;
memcpy(buf, ie, len);
kfree(ieee->wpa_ie);
ieee->wpa_ie = buf;
ieee->wpa_ie_len = len;
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/staging/rtl8192e/ieee80211/ieee80211_softmac.c
Original file line number Diff line number Diff line change
Expand Up @@ -3255,11 +3255,11 @@ static int ieee80211_wpa_set_wpa_ie(struct ieee80211_device *ieee,
return -EINVAL;

if (param->u.wpa_ie.len) {
buf = kmalloc(param->u.wpa_ie.len, GFP_KERNEL);
buf = kmemdup(param->u.wpa_ie.data, param->u.wpa_ie.len,
GFP_KERNEL);
if (buf == NULL)
return -ENOMEM;

memcpy(buf, param->u.wpa_ie.data, param->u.wpa_ie.len);
kfree(ieee->wpa_ie);
ieee->wpa_ie = buf;
ieee->wpa_ie_len = param->u.wpa_ie.len;
Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/staging/rtl8192e/ieee80211/ieee80211_wx.c
Original file line number Diff line number Diff line change
Expand Up @@ -979,10 +979,9 @@ int ieee80211_wx_set_gen_ie(struct ieee80211_device *ieee, u8 *ie, size_t len)
printk("len:%zu, ie:%d\n", len, ie[1]);
return -EINVAL;
}
buf = kmalloc(len, GFP_KERNEL);
buf = kmemdup(ie, len, GFP_KERNEL);
if (buf == NULL)
return -ENOMEM;
memcpy(buf, ie, len);
kfree(ieee->wpa_ie);
ieee->wpa_ie = buf;
ieee->wpa_ie_len = len;
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/staging/rtl8192su/ieee80211/ieee80211_softmac.c
Original file line number Diff line number Diff line change
Expand Up @@ -2844,11 +2844,11 @@ static int ieee80211_wpa_set_wpa_ie(struct ieee80211_device *ieee,
return -EINVAL;

if (param->u.wpa_ie.len) {
buf = kmalloc(param->u.wpa_ie.len, GFP_KERNEL);
buf = kmemdup(param->u.wpa_ie.data, param->u.wpa_ie.len,
GFP_KERNEL);
if (buf == NULL)
return -ENOMEM;

memcpy(buf, param->u.wpa_ie.data, param->u.wpa_ie.len);
kfree(ieee->wpa_ie);
ieee->wpa_ie = buf;
ieee->wpa_ie_len = param->u.wpa_ie.len;
Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/staging/rtl8192su/ieee80211/ieee80211_wx.c
Original file line number Diff line number Diff line change
Expand Up @@ -767,10 +767,9 @@ int ieee80211_wx_set_gen_ie(struct ieee80211_device *ieee, u8 *ie, size_t len)
printk("len: %Zd, ie:%d\n", len, ie[1]);
return -EINVAL;
}
buf = kmalloc(len, GFP_KERNEL);
buf = kmemdup(ie, len, GFP_KERNEL);
if (buf == NULL)
return -ENOMEM;
memcpy(buf, ie, len);
kfree(ieee->wpa_ie);
ieee->wpa_ie = buf;
ieee->wpa_ie_len = len;
Expand Down
7 changes: 3 additions & 4 deletions trunk/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
Original file line number Diff line number Diff line change
Expand Up @@ -1579,10 +1579,9 @@ static inline u16 auth_parse(struct sk_buff *skb, u8** challenge, int *chlen)

if(*(t++) == MFIE_TYPE_CHALLENGE){
*chlen = *(t++);
*challenge = kmalloc(*chlen, GFP_ATOMIC);
*challenge = kmemdup(t, *chlen, GFP_ATOMIC);
if (!*challenge)
return -ENOMEM;
memcpy(*challenge, t, *chlen);
}
}

Expand Down Expand Up @@ -2870,11 +2869,11 @@ static int ieee80211_wpa_set_wpa_ie(struct ieee80211_device *ieee,
return -EINVAL;

if (param->u.wpa_ie.len) {
buf = kmalloc(param->u.wpa_ie.len, GFP_KERNEL);
buf = kmemdup(param->u.wpa_ie.data, param->u.wpa_ie.len,
GFP_KERNEL);
if (buf == NULL)
return -ENOMEM;

memcpy(buf, param->u.wpa_ie.data, param->u.wpa_ie.len);
kfree(ieee->wpa_ie);
ieee->wpa_ie = buf;
ieee->wpa_ie_len = param->u.wpa_ie.len;
Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c
Original file line number Diff line number Diff line change
Expand Up @@ -847,10 +847,9 @@ int ieee80211_wx_set_gen_ie(struct ieee80211_device *ieee, u8 *ie, size_t len)
printk("len:%zu, ie:%d\n", len, ie[1]);
return -EINVAL;
}
buf = kmalloc(len, GFP_KERNEL);
buf = kmemdup(ie, len, GFP_KERNEL);
if (buf == NULL)
return -ENOMEM;
memcpy(buf, ie, len);
kfree(ieee->wpa_ie);
ieee->wpa_ie = buf;
ieee->wpa_ie_len = len;
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/staging/usbip/stub_rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -502,13 +502,13 @@ static void stub_recv_cmd_submit(struct stub_device *sdev,
}

/* set priv->urb->setup_packet */
priv->urb->setup_packet = kzalloc(8, GFP_KERNEL);
priv->urb->setup_packet = kmemdup(&pdu->u.cmd_submit.setup, 8,
GFP_KERNEL);
if (!priv->urb->setup_packet) {
dev_err(&sdev->interface->dev, "allocate setup_packet\n");
usbip_event_add(ud, SDEV_EVENT_ERROR_MALLOC);
return;
}
memcpy(priv->urb->setup_packet, &pdu->u.cmd_submit.setup, 8);

/* set other members from the base header of pdu */
priv->urb->context = (void *) priv;
Expand Down

0 comments on commit 82c1d99

Please sign in to comment.