Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 64003
b: refs/heads/master
c: 48e3eeb
h: refs/heads/master
i:
  64001: 141151c
  63999: 52f3550
v: v3
  • Loading branch information
Mariusz Kozlowski authored and David S. Miller committed Aug 14, 2007
1 parent bdfc7db commit 81e7dca
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 15 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: 1ee325438cdbe374ebea6e3d2f19204072c15038
refs/heads/master: 48e3eeb1a1a89a3ea256cf6d3c898e753787cfaa
24 changes: 10 additions & 14 deletions trunk/drivers/net/irda/irda-usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1561,10 +1561,9 @@ static inline struct irda_class_desc *irda_usb_find_class_desc(struct usb_interf
struct irda_class_desc *desc;
int ret;

desc = kmalloc(sizeof (*desc), GFP_KERNEL);
if (desc == NULL)
desc = kzalloc(sizeof(*desc), GFP_KERNEL);
if (!desc)
return NULL;
memset(desc, 0, sizeof(*desc));

/* USB-IrDA class spec 1.0:
* 6.1.3: Standard "Get Descriptor" Device Request is not
Expand Down Expand Up @@ -1617,7 +1616,7 @@ static int irda_usb_probe(struct usb_interface *intf,
{
struct net_device *net;
struct usb_device *dev = interface_to_usbdev(intf);
struct irda_usb_cb *self = NULL;
struct irda_usb_cb *self;
struct usb_host_interface *interface;
struct irda_class_desc *irda_desc;
int ret = -ENOMEM;
Expand Down Expand Up @@ -1655,7 +1654,7 @@ static int irda_usb_probe(struct usb_interface *intf,
self->header_length = USB_IRDA_HEADER;
}

self->rx_urb = kzalloc(self->max_rx_urb * sizeof(struct urb *),
self->rx_urb = kcalloc(self->max_rx_urb, sizeof(struct urb *),
GFP_KERNEL);

for (i = 0; i < self->max_rx_urb; i++) {
Expand Down Expand Up @@ -1715,7 +1714,7 @@ static int irda_usb_probe(struct usb_interface *intf,
/* Find IrDA class descriptor */
irda_desc = irda_usb_find_class_desc(intf);
ret = -ENODEV;
if (irda_desc == NULL)
if (!irda_desc)
goto err_out_3;

if (self->needspatch) {
Expand All @@ -1738,15 +1737,13 @@ static int irda_usb_probe(struct usb_interface *intf,
/* Don't change this buffer size and allocation without doing
* some heavy and complete testing. Don't ask why :-(
* Jean II */
self->speed_buff = kmalloc(IRDA_USB_SPEED_MTU, GFP_KERNEL);
if (self->speed_buff == NULL)
self->speed_buff = kzalloc(IRDA_USB_SPEED_MTU, GFP_KERNEL);
if (!self->speed_buff)
goto err_out_3;

memset(self->speed_buff, 0, IRDA_USB_SPEED_MTU);

self->tx_buff = kzalloc(IRDA_SKB_MAX_MTU + self->header_length,
GFP_KERNEL);
if (self->tx_buff == NULL)
if (!self->tx_buff)
goto err_out_4;

ret = irda_usb_open(self);
Expand All @@ -1767,12 +1764,11 @@ static int irda_usb_probe(struct usb_interface *intf,

/* replace IrDA class descriptor with what patched device is now reporting */
irda_desc = irda_usb_find_class_desc (self->usbintf);
if (irda_desc == NULL) {
if (!irda_desc) {
ret = -ENODEV;
goto err_out_6;
}
if (self->irda_desc)
kfree (self->irda_desc);
kfree(self->irda_desc);
self->irda_desc = irda_desc;
irda_usb_init_qos(self);
}
Expand Down

0 comments on commit 81e7dca

Please sign in to comment.