Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 9203
b: refs/heads/master
c: a85a46f
h: refs/heads/master
i:
  9201: d98df48
  9199: 9e649de
v: v3
  • Loading branch information
Kevin Vigor authored and Linus Torvalds committed Sep 22, 2005
1 parent d8a31cb commit 725e773
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 10 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: 4b2e790a4d73d729d936cc42f3b08af34f8ea5c6
refs/heads/master: a85a46f2c38def5150251816890393803fdae7d0
29 changes: 20 additions & 9 deletions trunk/drivers/usb/net/pegasus.c
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,13 @@ static void read_bulk_callback(struct urb *urb, struct pt_regs *regs)
pkt_len -= 8;
}

/*
* If the packet is unreasonably long, quietly drop it rather than
* kernel panicing by calling skb_put.
*/
if (pkt_len > PEGASUS_MTU)
goto goon;

/*
* at this point we are sure pegasus->rx_skb != NULL
* so we go ahead and pass up the packet.
Expand Down Expand Up @@ -886,15 +893,17 @@ static inline void get_interrupt_interval(pegasus_t * pegasus)
__u8 data[2];

read_eprom_word(pegasus, 4, (__u16 *) data);
if (data[1] < 0x80) {
if (netif_msg_timer(pegasus))
dev_info(&pegasus->intf->dev,
"intr interval changed from %ums to %ums\n",
data[1], 0x80);
data[1] = 0x80;
#ifdef PEGASUS_WRITE_EEPROM
write_eprom_word(pegasus, 4, *(__u16 *) data);
if (pegasus->usb->speed != USB_SPEED_HIGH) {
if (data[1] < 0x80) {
if (netif_msg_timer(pegasus))
dev_info(&pegasus->intf->dev, "intr interval "
"changed from %ums to %ums\n",
data[1], 0x80);
data[1] = 0x80;
#ifdef PEGASUS_WRITE_EEPROM
write_eprom_word(pegasus, 4, *(__u16 *) data);
#endif
}
}
pegasus->intr_interval = data[1];
}
Expand All @@ -904,8 +913,9 @@ static void set_carrier(struct net_device *net)
pegasus_t *pegasus = netdev_priv(net);
u16 tmp;

if (read_mii_word(pegasus, pegasus->phy, MII_BMSR, &tmp))
if (!read_mii_word(pegasus, pegasus->phy, MII_BMSR, &tmp))
return;

if (tmp & BMSR_LSTATUS)
netif_carrier_on(net);
else
Expand Down Expand Up @@ -1355,6 +1365,7 @@ static void pegasus_disconnect(struct usb_interface *intf)
cancel_delayed_work(&pegasus->carrier_check);
unregister_netdev(pegasus->net);
usb_put_dev(interface_to_usbdev(intf));
unlink_all_urbs(pegasus);
free_all_urbs(pegasus);
free_skb_pool(pegasus);
if (pegasus->rx_skb)
Expand Down

0 comments on commit 725e773

Please sign in to comment.