Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 300717
b: refs/heads/master
c: e65ac4d
h: refs/heads/master
i:
  300715: 47222e8
v: v3
  • Loading branch information
David S. Miller committed Apr 13, 2012
1 parent 628a8d9 commit ca26f73
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 33 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: 816a7854d56f19aeba3c83e1ed8c2c0ef275365a
refs/heads/master: e65ac4d54546b7d7514a9e8be1484c758f2b7ba3
9 changes: 5 additions & 4 deletions trunk/drivers/net/caif/caif_hsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -744,14 +744,14 @@ static void cfhsi_wake_up(struct work_struct *work)
size_t fifo_occupancy = 0;

/* Wakeup timeout */
dev_err(&cfhsi->ndev->dev, "%s: Timeout.\n",
dev_dbg(&cfhsi->ndev->dev, "%s: Timeout.\n",
__func__);

/* Check FIFO to check if modem has sent something. */
WARN_ON(cfhsi->dev->cfhsi_fifo_occupancy(cfhsi->dev,
&fifo_occupancy));

dev_err(&cfhsi->ndev->dev, "%s: Bytes in FIFO: %u.\n",
dev_dbg(&cfhsi->ndev->dev, "%s: Bytes in FIFO: %u.\n",
__func__, (unsigned) fifo_occupancy);

/* Check if we misssed the interrupt. */
Expand Down Expand Up @@ -1210,7 +1210,7 @@ int cfhsi_probe(struct platform_device *pdev)

static void cfhsi_shutdown(struct cfhsi *cfhsi)
{
u8 *tx_buf, *rx_buf;
u8 *tx_buf, *rx_buf, *flip_buf;

/* Stop TXing */
netif_tx_stop_all_queues(cfhsi->ndev);
Expand All @@ -1234,7 +1234,7 @@ static void cfhsi_shutdown(struct cfhsi *cfhsi)
/* Store bufferes: will be freed later. */
tx_buf = cfhsi->tx_buf;
rx_buf = cfhsi->rx_buf;

flip_buf = cfhsi->rx_flip_buf;
/* Flush transmit queues. */
cfhsi_abort_tx(cfhsi);

Expand All @@ -1247,6 +1247,7 @@ static void cfhsi_shutdown(struct cfhsi *cfhsi)
/* Free buffers. */
kfree(tx_buf);
kfree(rx_buf);
kfree(flip_buf);
}

int cfhsi_remove(struct platform_device *pdev)
Expand Down
5 changes: 2 additions & 3 deletions trunk/drivers/net/virtio_net.c
Original file line number Diff line number Diff line change
Expand Up @@ -626,16 +626,15 @@ static netdev_tx_t start_xmit(struct sk_buff *skb, struct net_device *dev)
/* This can happen with OOM and indirect buffers. */
if (unlikely(capacity < 0)) {
if (likely(capacity == -ENOMEM)) {
if (net_ratelimit()) {
if (net_ratelimit())
dev_warn(&dev->dev,
"TX queue failure: out of memory\n");
} else {
} else {
dev->stats.tx_fifo_errors++;
if (net_ratelimit())
dev_warn(&dev->dev,
"Unexpected TX queue failure: %d\n",
capacity);
}
}
dev->stats.tx_dropped++;
kfree_skb(skb);
Expand Down
9 changes: 6 additions & 3 deletions trunk/net/caif/chnl_net.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ static int chnl_recv_cb(struct cflayer *layr, struct cfpkt *pkt)
skb->protocol = htons(ETH_P_IPV6);
break;
default:
kfree_skb(skb);
priv->netdev->stats.rx_errors++;
return -EINVAL;
}
Expand Down Expand Up @@ -220,14 +221,16 @@ static int chnl_net_start_xmit(struct sk_buff *skb, struct net_device *dev)

if (skb->len > priv->netdev->mtu) {
pr_warn("Size of skb exceeded MTU\n");
kfree_skb(skb);
dev->stats.tx_errors++;
return -ENOSPC;
return NETDEV_TX_OK;
}

if (!priv->flowenabled) {
pr_debug("dropping packets flow off\n");
kfree_skb(skb);
dev->stats.tx_dropped++;
return NETDEV_TX_BUSY;
return NETDEV_TX_OK;
}

if (priv->conn_req.protocol == CAIFPROTO_DATAGRAM_LOOP)
Expand All @@ -242,7 +245,7 @@ static int chnl_net_start_xmit(struct sk_buff *skb, struct net_device *dev)
result = priv->chnl.dn->transmit(priv->chnl.dn, pkt);
if (result) {
dev->stats.tx_dropped++;
return result;
return NETDEV_TX_OK;
}

/* Update statistics. */
Expand Down
20 changes: 20 additions & 0 deletions trunk/net/core/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -1409,14 +1409,34 @@ EXPORT_SYMBOL(register_netdevice_notifier);
* register_netdevice_notifier(). The notifier is unlinked into the
* kernel structures and may then be reused. A negative errno code
* is returned on a failure.
*
* After unregistering unregister and down device events are synthesized
* for all devices on the device list to the removed notifier to remove
* the need for special case cleanup code.
*/

int unregister_netdevice_notifier(struct notifier_block *nb)
{
struct net_device *dev;
struct net *net;
int err;

rtnl_lock();
err = raw_notifier_chain_unregister(&netdev_chain, nb);
if (err)
goto unlock;

for_each_net(net) {
for_each_netdev(net, dev) {
if (dev->flags & IFF_UP) {
nb->notifier_call(nb, NETDEV_GOING_DOWN, dev);
nb->notifier_call(nb, NETDEV_DOWN, dev);
}
nb->notifier_call(nb, NETDEV_UNREGISTER, dev);
nb->notifier_call(nb, NETDEV_UNREGISTER_BATCH, dev);
}
}
unlock:
rtnl_unlock();
return err;
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/key/af_key.c
Original file line number Diff line number Diff line change
Expand Up @@ -3480,7 +3480,7 @@ static int pfkey_send_migrate(const struct xfrm_selector *sel, u8 dir, u8 type,

/* Addresses to be used by KM for negotiation, if ext is available */
if (k != NULL && (set_sadb_kmaddress(skb, k) < 0))
return -EINVAL;
goto err;

/* selector src */
set_sadb_address(skb, sasize_sel, SADB_EXT_ADDRESS_SRC, sel);
Expand Down
5 changes: 3 additions & 2 deletions trunk/net/l2tp/l2tp_ip.c
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ static void l2tp_ip_close(struct sock *sk, long timeout)
{
write_lock_bh(&l2tp_ip_lock);
hlist_del_init(&sk->sk_bind_node);
hlist_del_init(&sk->sk_node);
sk_del_node_init(sk);
write_unlock_bh(&l2tp_ip_lock);
sk_common_release(sk);
}
Expand Down Expand Up @@ -271,7 +271,8 @@ static int l2tp_ip_bind(struct sock *sk, struct sockaddr *uaddr, int addr_len)
chk_addr_ret != RTN_MULTICAST && chk_addr_ret != RTN_BROADCAST)
goto out;

inet->inet_rcv_saddr = inet->inet_saddr = addr->l2tp_addr.s_addr;
if (addr->l2tp_addr.s_addr)
inet->inet_rcv_saddr = inet->inet_saddr = addr->l2tp_addr.s_addr;
if (chk_addr_ret == RTN_MULTICAST || chk_addr_ret == RTN_BROADCAST)
inet->inet_saddr = 0; /* Use device */
sk_dst_reset(sk);
Expand Down
21 changes: 2 additions & 19 deletions trunk/net/phonet/pn_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -331,23 +331,6 @@ static int __net_init phonet_init_net(struct net *net)

static void __net_exit phonet_exit_net(struct net *net)
{
struct phonet_net *pnn = phonet_pernet(net);
struct net_device *dev;
unsigned i;

rtnl_lock();
for_each_netdev(net, dev)
phonet_device_destroy(dev);

for (i = 0; i < 64; i++) {
dev = pnn->routes.table[i];
if (dev) {
rtm_phonet_notify(RTM_DELROUTE, dev, i);
dev_put(dev);
}
}
rtnl_unlock();

proc_net_remove(net, "phonet");
}

Expand All @@ -361,7 +344,7 @@ static struct pernet_operations phonet_net_ops = {
/* Initialize Phonet devices list */
int __init phonet_device_init(void)
{
int err = register_pernet_device(&phonet_net_ops);
int err = register_pernet_subsys(&phonet_net_ops);
if (err)
return err;

Expand All @@ -377,7 +360,7 @@ void phonet_device_exit(void)
{
rtnl_unregister_all(PF_PHONET);
unregister_netdevice_notifier(&phonet_device_notifier);
unregister_pernet_device(&phonet_net_ops);
unregister_pernet_subsys(&phonet_net_ops);
proc_net_remove(&init_net, "pnresource");
}

Expand Down

0 comments on commit ca26f73

Please sign in to comment.