Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 103382
b: refs/heads/master
c: 7c3ceb4
h: refs/heads/master
v: v3
  • Loading branch information
David S. Miller committed Jul 8, 2008
1 parent 92ce61a commit 4588d32
Show file tree
Hide file tree
Showing 16 changed files with 78 additions and 27 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: 54dceb008ffcbe003bea9017cad1227a83b6fc3f
refs/heads/master: 7c3ceb4a409e2b838700edf081d61a8a4c921e79
1 change: 1 addition & 0 deletions trunk/drivers/net/irda/nsc-ircc.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ static chipio_t pnp_info;
static const struct pnp_device_id nsc_ircc_pnp_table[] = {
{ .id = "NSC6001", .driver_data = 0 },
{ .id = "IBM0071", .driver_data = 0 },
{ .id = "HWPC224", .driver_data = 0 },
{ }
};

Expand Down
3 changes: 3 additions & 0 deletions trunk/drivers/net/irda/via-ircc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1546,6 +1546,7 @@ static int via_ircc_net_open(struct net_device *dev)
IRDA_WARNING("%s, unable to allocate dma2=%d\n",
driver_name, self->io.dma2);
free_irq(self->io.irq, self);
free_dma(self->io.dma);
return -EAGAIN;
}
}
Expand Down Expand Up @@ -1606,6 +1607,8 @@ static int via_ircc_net_close(struct net_device *dev)
EnAllInt(iobase, OFF);
free_irq(self->io.irq, dev);
free_dma(self->io.dma);
if (self->io.dma2 != self->io.dma)
free_dma(self->io.dma2);

return 0;
}
Expand Down
12 changes: 8 additions & 4 deletions trunk/drivers/net/wireless/hostap/hostap_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -777,8 +777,10 @@ static int hostap_cs_suspend(struct pcmcia_device *link)
int dev_open = 0;
struct hostap_interface *iface = NULL;

if (dev)
iface = netdev_priv(dev);
if (!dev)
return -ENODEV;

iface = netdev_priv(dev);

PDEBUG(DEBUG_EXTRA, "%s: CS_EVENT_PM_SUSPEND\n", dev_info);
if (iface && iface->local)
Expand All @@ -798,8 +800,10 @@ static int hostap_cs_resume(struct pcmcia_device *link)
int dev_open = 0;
struct hostap_interface *iface = NULL;

if (dev)
iface = netdev_priv(dev);
if (!dev)
return -ENODEV;

iface = netdev_priv(dev);

PDEBUG(DEBUG_EXTRA, "%s: CS_EVENT_PM_RESUME\n", dev_info);

Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/net/wireless/iwlwifi/iwl-3945.c
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ static void iwl3945_dbg_report_frame(struct iwl3945_priv *priv,

if (print_summary) {
char *title;
u32 rate;
int rate;

if (hundred)
title = "100Frames";
Expand Down Expand Up @@ -489,7 +489,7 @@ static void iwl3945_dbg_report_frame(struct iwl3945_priv *priv,
* but you can hack it to show more, if you'd like to. */
if (dataframe)
IWL_DEBUG_RX("%s: mhd=0x%04x, dst=0x%02x, "
"len=%u, rssi=%d, chnl=%d, rate=%u, \n",
"len=%u, rssi=%d, chnl=%d, rate=%d, \n",
title, le16_to_cpu(fc), header->addr1[5],
length, rssi, channel, rate);
else {
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/net/wireless/zd1211rw/zd_usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ static struct usb_device_id usb_ids[] = {
{ USB_DEVICE(0x079b, 0x0062), .driver_info = DEVICE_ZD1211B },
{ USB_DEVICE(0x1582, 0x6003), .driver_info = DEVICE_ZD1211B },
{ USB_DEVICE(0x050d, 0x705c), .driver_info = DEVICE_ZD1211B },
{ USB_DEVICE(0x083a, 0xe506), .driver_info = DEVICE_ZD1211B },
{ USB_DEVICE(0x083a, 0x4505), .driver_info = DEVICE_ZD1211B },
{ USB_DEVICE(0x0471, 0x1236), .driver_info = DEVICE_ZD1211B },
{ USB_DEVICE(0x13b1, 0x0024), .driver_info = DEVICE_ZD1211B },
Expand Down
7 changes: 7 additions & 0 deletions trunk/drivers/ssb/driver_pcicore.c
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,13 @@ int ssb_pcicore_dev_irqvecs_enable(struct ssb_pcicore *pc,
int err = 0;
u32 tmp;

if (dev->bus->bustype != SSB_BUSTYPE_PCI) {
/* This SSB device is not on a PCI host-bus. So the IRQs are
* not routed through the PCI core.
* So we must not enable routing through the PCI core. */
goto out;
}

if (!pdev)
goto out;
bus = pdev->bus;
Expand Down
10 changes: 10 additions & 0 deletions trunk/net/can/af_can.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,12 +205,19 @@ static int can_create(struct net *net, struct socket *sock, int protocol)
* -ENOBUFS on full driver queue (see net_xmit_errno())
* -ENOMEM when local loopback failed at calling skb_clone()
* -EPERM when trying to send on a non-CAN interface
* -EINVAL when the skb->data does not contain a valid CAN frame
*/
int can_send(struct sk_buff *skb, int loop)
{
struct sk_buff *newskb = NULL;
struct can_frame *cf = (struct can_frame *)skb->data;
int err;

if (skb->len != sizeof(struct can_frame) || cf->can_dlc > 8) {
kfree_skb(skb);
return -EINVAL;
}

if (skb->dev->type != ARPHRD_CAN) {
kfree_skb(skb);
return -EPERM;
Expand Down Expand Up @@ -605,13 +612,16 @@ static int can_rcv(struct sk_buff *skb, struct net_device *dev,
struct packet_type *pt, struct net_device *orig_dev)
{
struct dev_rcv_lists *d;
struct can_frame *cf = (struct can_frame *)skb->data;
int matches;

if (dev->type != ARPHRD_CAN || dev_net(dev) != &init_net) {
kfree_skb(skb);
return 0;
}

BUG_ON(skb->len != sizeof(struct can_frame) || cf->can_dlc > 8);

/* update statistics */
can_stats.rx_frames++;
can_stats.rx_frames_delta++;
Expand Down
23 changes: 19 additions & 4 deletions trunk/net/can/bcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ static void bcm_send_to_user(struct bcm_op *op, struct bcm_msg_head *head,

if (head->nframes) {
/* can_frames starting here */
firstframe = (struct can_frame *) skb_tail_pointer(skb);
firstframe = (struct can_frame *)skb_tail_pointer(skb);

memcpy(skb_put(skb, datalen), frames, datalen);

Expand Down Expand Up @@ -826,6 +826,10 @@ static int bcm_tx_setup(struct bcm_msg_head *msg_head, struct msghdr *msg,
for (i = 0; i < msg_head->nframes; i++) {
err = memcpy_fromiovec((u8 *)&op->frames[i],
msg->msg_iov, CFSIZ);

if (op->frames[i].can_dlc > 8)
err = -EINVAL;

if (err < 0)
return err;

Expand Down Expand Up @@ -858,6 +862,10 @@ static int bcm_tx_setup(struct bcm_msg_head *msg_head, struct msghdr *msg,
for (i = 0; i < msg_head->nframes; i++) {
err = memcpy_fromiovec((u8 *)&op->frames[i],
msg->msg_iov, CFSIZ);

if (op->frames[i].can_dlc > 8)
err = -EINVAL;

if (err < 0) {
if (op->frames != &op->sframe)
kfree(op->frames);
Expand Down Expand Up @@ -1164,9 +1172,12 @@ static int bcm_tx_send(struct msghdr *msg, int ifindex, struct sock *sk)

skb->dev = dev;
skb->sk = sk;
can_send(skb, 1); /* send with loopback */
err = can_send(skb, 1); /* send with loopback */
dev_put(dev);

if (err)
return err;

return CFSIZ + MHSIZ;
}

Expand All @@ -1185,6 +1196,10 @@ static int bcm_sendmsg(struct kiocb *iocb, struct socket *sock,
if (!bo->bound)
return -ENOTCONN;

/* check for valid message length from userspace */
if (size < MHSIZ || (size - MHSIZ) % CFSIZ)
return -EINVAL;

/* check for alternative ifindex for this bcm_op */

if (!ifindex && msg->msg_name) {
Expand Down Expand Up @@ -1259,8 +1274,8 @@ static int bcm_sendmsg(struct kiocb *iocb, struct socket *sock,
break;

case TX_SEND:
/* we need at least one can_frame */
if (msg_head.nframes < 1)
/* we need exactly one can_frame behind the msg head */
if ((msg_head.nframes != 1) || (size != CFSIZ + MHSIZ))
ret = -EINVAL;
else
ret = bcm_tx_send(msg, ifindex, sk);
Expand Down
3 changes: 3 additions & 0 deletions trunk/net/can/raw.c
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,9 @@ static int raw_sendmsg(struct kiocb *iocb, struct socket *sock,
} else
ifindex = ro->ifindex;

if (size != sizeof(struct can_frame))
return -EINVAL;

dev = dev_get_by_index(&init_net, ifindex);
if (!dev)
return -ENXIO;
Expand Down
4 changes: 2 additions & 2 deletions trunk/net/ipv6/addrconf.c
Original file line number Diff line number Diff line change
Expand Up @@ -774,12 +774,12 @@ static void ipv6_del_addr(struct inet6_ifaddr *ifp)
}
write_unlock_bh(&idev->lock);

addrconf_del_timer(ifp);

ipv6_ifa_notify(RTM_DELADDR, ifp);

atomic_notifier_call_chain(&inet6addr_chain, NETDEV_DOWN, ifp);

addrconf_del_timer(ifp);

/*
* Purge or update corresponding prefix
*
Expand Down
4 changes: 2 additions & 2 deletions trunk/net/irda/irnetlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ static int irda_nl_get_mode(struct sk_buff *skb, struct genl_info *info)

hdr = genlmsg_put(msg, info->snd_pid, info->snd_seq,
&irda_nl_family, 0, IRDA_NL_CMD_GET_MODE);
if (IS_ERR(hdr)) {
ret = PTR_ERR(hdr);
if (hdr == NULL) {
ret = -EMSGSIZE;
goto err_out;
}

Expand Down
4 changes: 2 additions & 2 deletions trunk/net/mac80211/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -535,8 +535,6 @@ static int ieee80211_stop(struct net_device *dev)
local->sta_hw_scanning = 0;
}

flush_workqueue(local->hw.workqueue);

sdata->u.sta.flags &= ~IEEE80211_STA_PRIVACY_INVOKED;
kfree(sdata->u.sta.extra_ie);
sdata->u.sta.extra_ie = NULL;
Expand All @@ -560,6 +558,8 @@ static int ieee80211_stop(struct net_device *dev)

ieee80211_led_radio(local, 0);

flush_workqueue(local->hw.workqueue);

tasklet_disable(&local->tx_pending_tasklet);
tasklet_disable(&local->tasklet);
}
Expand Down
13 changes: 9 additions & 4 deletions trunk/net/mac80211/mlme.c
Original file line number Diff line number Diff line change
Expand Up @@ -564,15 +564,14 @@ static void ieee80211_set_associated(struct net_device *dev,
sdata->bss_conf.ht_bss_conf = &conf->ht_bss_conf;
}

netif_carrier_on(dev);
ifsta->flags |= IEEE80211_STA_PREV_BSSID_SET;
memcpy(ifsta->prev_bssid, sdata->u.sta.bssid, ETH_ALEN);
memcpy(wrqu.ap_addr.sa_data, sdata->u.sta.bssid, ETH_ALEN);
ieee80211_sta_send_associnfo(dev, ifsta);
} else {
netif_carrier_off(dev);
ieee80211_sta_tear_down_BA_sessions(dev, ifsta->bssid);
ifsta->flags &= ~IEEE80211_STA_ASSOCIATED;
netif_carrier_off(dev);
changed |= ieee80211_reset_erp_info(dev);

sdata->bss_conf.assoc_ht = 0;
Expand All @@ -586,6 +585,10 @@ static void ieee80211_set_associated(struct net_device *dev,

sdata->bss_conf.assoc = assoc;
ieee80211_bss_info_change_notify(sdata, changed);

if (assoc)
netif_carrier_on(dev);

wrqu.ap_addr.sa_family = ARPHRD_ETHER;
wireless_send_event(dev, SIOCGIWAP, &wrqu, NULL);
}
Expand Down Expand Up @@ -3694,8 +3697,10 @@ static int ieee80211_sta_find_ibss(struct net_device *dev,
spin_unlock_bh(&local->sta_bss_lock);

#ifdef CONFIG_MAC80211_IBSS_DEBUG
printk(KERN_DEBUG " sta_find_ibss: selected %s current "
"%s\n", print_mac(mac, bssid), print_mac(mac2, ifsta->bssid));
if (found)
printk(KERN_DEBUG " sta_find_ibss: selected %s current "
"%s\n", print_mac(mac, bssid),
print_mac(mac2, ifsta->bssid));
#endif /* CONFIG_MAC80211_IBSS_DEBUG */
if (found && memcmp(ifsta->bssid, bssid, ETH_ALEN) != 0 &&
(bss = ieee80211_rx_bss_get(dev, bssid,
Expand Down
9 changes: 3 additions & 6 deletions trunk/net/sctp/sm_statefuns.c
Original file line number Diff line number Diff line change
Expand Up @@ -5893,12 +5893,6 @@ static int sctp_eat_data(const struct sctp_association *asoc,
return SCTP_IERROR_NO_DATA;
}

/* If definately accepting the DATA chunk, record its TSN, otherwise
* wait for renege processing.
*/
if (SCTP_CMD_CHUNK_ULP == deliver)
sctp_add_cmd_sf(commands, SCTP_CMD_REPORT_TSN, SCTP_U32(tsn));

chunk->data_accepted = 1;

/* Note: Some chunks may get overcounted (if we drop) or overcounted
Expand All @@ -5918,6 +5912,9 @@ static int sctp_eat_data(const struct sctp_association *asoc,
* and discard the DATA chunk.
*/
if (ntohs(data_hdr->stream) >= asoc->c.sinit_max_instreams) {
/* Mark tsn as received even though we drop it */
sctp_add_cmd_sf(commands, SCTP_CMD_REPORT_TSN, SCTP_U32(tsn));

err = sctp_make_op_error(asoc, chunk, SCTP_ERROR_INV_STRM,
&data_hdr->stream,
sizeof(data_hdr->stream));
Expand Down
5 changes: 5 additions & 0 deletions trunk/net/sctp/ulpevent.c
Original file line number Diff line number Diff line change
Expand Up @@ -710,6 +710,11 @@ struct sctp_ulpevent *sctp_ulpevent_make_rcvmsg(struct sctp_association *asoc,
if (!skb)
goto fail;

/* Now that all memory allocations for this chunk succeeded, we
* can mark it as received so the tsn_map is updated correctly.
*/
sctp_tsnmap_mark(&asoc->peer.tsn_map, ntohl(chunk->subh.data_hdr->tsn));

/* First calculate the padding, so we don't inadvertently
* pass up the wrong length to the user.
*
Expand Down

0 comments on commit 4588d32

Please sign in to comment.