Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
Browse files Browse the repository at this point in the history
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (26 commits)
  pkt_sched: Fix lockdep warning on est_tree_lock in gen_estimator
  ipvs: avoid oops for passive FTP
  Revert "sky2: don't do GRO on second port"
  gro: fix different skb headrooms
  bridge: Clear INET control block of SKBs passed into ip_fragment().
  3c59x: Remove incorrect locking; correct documented lock hierarchy
  sky2: don't do GRO on second port
  ipv4: minor fix about RPF in help of Kconfig
  xfrm_user: avoid a warning with some compiler
  net/sched/sch_hfsc.c: initialize parent's cl_cfmin properly in init_vf()
  pxa168_eth: fix a mdiobus leak
  net sched: fix kernel leak in act_police
  vhost: stop worker only if created
  MAINTAINERS: Add ehea driver as Supported
  ath9k_hw: fix parsing of HT40 5 GHz CTLs
  ath9k_hw: Fix EEPROM uncompress block reading on AR9003
  wireless: register wiphy rfkill w/o holding cfg80211_mutex
  netlink: Make NETLINK_USERSOCK work again.
  irda: Correctly clean up self->ias_obj on irda_bind() failure.
  wireless extensions: fix kernel heap content leak
  ...
  • Loading branch information
torvalds committed Sep 7, 2010
2 parents 96d4cbb + 0b5d404 commit 608307e
Show file tree
Hide file tree
Showing 25 changed files with 114 additions and 48 deletions.
8 changes: 7 additions & 1 deletion MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -2201,6 +2201,12 @@ L: [email protected]
S: Supported
F: drivers/infiniband/hw/ehca/

EHEA (IBM pSeries eHEA 10Gb ethernet adapter) DRIVER
M: Breno Leitao <[email protected]>
L: [email protected]
S: Maintained
F: drivers/net/ehea/

EMBEDDED LINUX
M: Paul Gortmaker <[email protected]>
M: Matt Mackall <[email protected]>
Expand Down Expand Up @@ -4603,7 +4609,7 @@ F: include/linux/preempt.h
PRISM54 WIRELESS DRIVER
M: "Luis R. Rodriguez" <[email protected]>
L: [email protected]
W: http://prism54.org
W: http://wireless.kernel.org/en/users/Drivers/p54
S: Obsolete
F: drivers/net/wireless/prism54/

Expand Down
5 changes: 1 addition & 4 deletions drivers/net/3c59x.c
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ struct vortex_private {
u16 io_size; /* Size of PCI region (for release_region) */

/* Serialises access to hardware other than MII and variables below.
* The lock hierarchy is rtnl_lock > lock > mii_lock > window_lock. */
* The lock hierarchy is rtnl_lock > {lock, mii_lock} > window_lock. */
spinlock_t lock;

spinlock_t mii_lock; /* Serialises access to MII */
Expand Down Expand Up @@ -2984,7 +2984,6 @@ static int vortex_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
{
int err;
struct vortex_private *vp = netdev_priv(dev);
unsigned long flags;
pci_power_t state = 0;

if(VORTEX_PCI(vp))
Expand All @@ -2994,9 +2993,7 @@ static int vortex_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)

if(state != 0)
pci_set_power_state(VORTEX_PCI(vp), PCI_D0);
spin_lock_irqsave(&vp->lock, flags);
err = generic_mii_ioctl(&vp->mii, if_mii(rq), cmd, NULL);
spin_unlock_irqrestore(&vp->lock, flags);
if(state != 0)
pci_set_power_state(VORTEX_PCI(vp), state);

Expand Down
1 change: 1 addition & 0 deletions drivers/net/pcmcia/pcnet_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1637,6 +1637,7 @@ static struct pcmcia_device_id pcnet_ids[] = {
PCMCIA_DEVICE_PROD_ID12("IO DATA", "PCETTX", 0x547e66dc, 0x6fc5459b),
PCMCIA_DEVICE_PROD_ID12("iPort", "10/100 Ethernet Card", 0x56c538d2, 0x11b0ffc0),
PCMCIA_DEVICE_PROD_ID12("KANSAI ELECTRIC CO.,LTD", "KLA-PCM/T", 0xb18dc3b4, 0xcc51a956),
PCMCIA_DEVICE_PROD_ID12("KENTRONICS", "KEP-230", 0xaf8144c9, 0x868f6616),
PCMCIA_DEVICE_PROD_ID12("KCI", "PE520 PCMCIA Ethernet Adapter", 0xa89b87d3, 0x1eb88e64),
PCMCIA_DEVICE_PROD_ID12("KINGMAX", "EN10T2T", 0x7bcb459a, 0xa5c81fa5),
PCMCIA_DEVICE_PROD_ID12("Kingston", "KNE-PC2", 0x1128e633, 0xce2a89b3),
Expand Down
2 changes: 2 additions & 0 deletions drivers/net/pxa168_eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -1606,6 +1606,8 @@ static int pxa168_eth_remove(struct platform_device *pdev)

iounmap(pep->base);
pep->base = NULL;
mdiobus_unregister(pep->smi_bus);
mdiobus_free(pep->smi_bus);
unregister_netdev(dev);
flush_scheduled_work();
free_netdev(dev);
Expand Down
4 changes: 4 additions & 0 deletions drivers/net/wireless/ath/ath5k/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -1327,6 +1327,10 @@ ath5k_txbuf_setup(struct ath5k_softc *sc, struct ath5k_buf *bf,
PCI_DMA_TODEVICE);

rate = ieee80211_get_tx_rate(sc->hw, info);
if (!rate) {
ret = -EINVAL;
goto err_unmap;
}

if (info->flags & IEEE80211_TX_CTL_NO_ACK)
flags |= AR5K_TXDESC_NOACK;
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
Original file line number Diff line number Diff line change
Expand Up @@ -797,7 +797,7 @@ static bool ar9300_uncompress_block(struct ath_hw *ah,
length = block[it+1];
length &= 0xff;

if (length > 0 && spot >= 0 && spot+length < mdataSize) {
if (length > 0 && spot >= 0 && spot+length <= mdataSize) {
ath_print(common, ATH_DBG_EEPROM,
"Restore at %d: spot=%d "
"offset=%d length=%d\n",
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/ath/ath9k/eeprom.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@

#define SD_NO_CTL 0xE0
#define NO_CTL 0xff
#define CTL_MODE_M 7
#define CTL_MODE_M 0xf
#define CTL_11A 0
#define CTL_11B 1
#define CTL_11G 2
Expand Down
1 change: 0 additions & 1 deletion drivers/net/wireless/ath/regd.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ enum ctl_group {
#define NO_CTL 0xff
#define SD_NO_CTL 0xE0
#define NO_CTL 0xff
#define CTL_MODE_M 7
#define CTL_11A 0
#define CTL_11B 1
#define CTL_11G 2
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/libertas/if_sdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ struct if_sdio_card {
bool helper_allocated;
bool firmware_allocated;

u8 buffer[65536];
u8 buffer[65536] __attribute__((aligned(4)));

spinlock_t lock;
struct if_sdio_packet *packets;
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/p54/txrx.c
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ static void p54_rx_frame_sent(struct p54_common *priv, struct sk_buff *skb)
}

if (!(info->flags & IEEE80211_TX_CTL_NO_ACK) &&
(!payload->status))
!(payload->status & P54_TX_FAILED))
info->flags |= IEEE80211_TX_STAT_ACK;
if (payload->status & P54_TX_PSM_CANCELLED)
info->flags |= IEEE80211_TX_STAT_TX_FILTERED;
Expand Down
5 changes: 4 additions & 1 deletion drivers/vhost/vhost.c
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,10 @@ void vhost_dev_cleanup(struct vhost_dev *dev)
dev->mm = NULL;

WARN_ON(!list_empty(&dev->work_list));
kthread_stop(dev->worker);
if (dev->worker) {
kthread_stop(dev->worker);
dev->worker = NULL;
}
}

static int log_access_ok(void __user *log_base, u64 addr, unsigned long sz)
Expand Down
6 changes: 4 additions & 2 deletions net/bridge/br_netfilter.c
Original file line number Diff line number Diff line change
Expand Up @@ -761,9 +761,11 @@ static int br_nf_dev_queue_xmit(struct sk_buff *skb)
{
if (skb->nfct != NULL && skb->protocol == htons(ETH_P_IP) &&
skb->len + nf_bridge_mtu_reduction(skb) > skb->dev->mtu &&
!skb_is_gso(skb))
!skb_is_gso(skb)) {
/* BUG: Should really parse the IP options here. */
memset(IPCB(skb), 0, sizeof(struct inet_skb_parm));
return ip_fragment(skb, br_dev_queue_push_xmit);
else
} else
return br_dev_queue_push_xmit(skb);
}
#else
Expand Down
12 changes: 6 additions & 6 deletions net/core/gen_estimator.c
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ int gen_new_estimator(struct gnet_stats_basic_packed *bstats,
est->last_packets = bstats->packets;
est->avpps = rate_est->pps<<10;

spin_lock(&est_tree_lock);
spin_lock_bh(&est_tree_lock);
if (!elist[idx].timer.function) {
INIT_LIST_HEAD(&elist[idx].list);
setup_timer(&elist[idx].timer, est_timer, idx);
Expand All @@ -243,7 +243,7 @@ int gen_new_estimator(struct gnet_stats_basic_packed *bstats,

list_add_rcu(&est->list, &elist[idx].list);
gen_add_node(est);
spin_unlock(&est_tree_lock);
spin_unlock_bh(&est_tree_lock);

return 0;
}
Expand All @@ -270,7 +270,7 @@ void gen_kill_estimator(struct gnet_stats_basic_packed *bstats,
{
struct gen_estimator *e;

spin_lock(&est_tree_lock);
spin_lock_bh(&est_tree_lock);
while ((e = gen_find_node(bstats, rate_est))) {
rb_erase(&e->node, &est_root);

Expand All @@ -281,7 +281,7 @@ void gen_kill_estimator(struct gnet_stats_basic_packed *bstats,
list_del_rcu(&e->list);
call_rcu(&e->e_rcu, __gen_kill_estimator);
}
spin_unlock(&est_tree_lock);
spin_unlock_bh(&est_tree_lock);
}
EXPORT_SYMBOL(gen_kill_estimator);

Expand Down Expand Up @@ -320,9 +320,9 @@ bool gen_estimator_active(const struct gnet_stats_basic_packed *bstats,

ASSERT_RTNL();

spin_lock(&est_tree_lock);
spin_lock_bh(&est_tree_lock);
res = gen_find_node(bstats, rate_est) != NULL;
spin_unlock(&est_tree_lock);
spin_unlock_bh(&est_tree_lock);

return res;
}
Expand Down
8 changes: 6 additions & 2 deletions net/core/skbuff.c
Original file line number Diff line number Diff line change
Expand Up @@ -2573,6 +2573,10 @@ struct sk_buff *skb_segment(struct sk_buff *skb, int features)
__copy_skb_header(nskb, skb);
nskb->mac_len = skb->mac_len;

/* nskb and skb might have different headroom */
if (nskb->ip_summed == CHECKSUM_PARTIAL)
nskb->csum_start += skb_headroom(nskb) - headroom;

skb_reset_mac_header(nskb);
skb_set_network_header(nskb, skb->mac_len);
nskb->transport_header = (nskb->network_header +
Expand Down Expand Up @@ -2702,8 +2706,8 @@ int skb_gro_receive(struct sk_buff **head, struct sk_buff *skb)
} else if (skb_gro_len(p) != pinfo->gso_size)
return -E2BIG;

headroom = skb_headroom(p);
nskb = netdev_alloc_skb(p->dev, headroom + skb_gro_offset(p));
headroom = NET_SKB_PAD + NET_IP_ALIGN;
nskb = alloc_skb(headroom + skb_gro_offset(p), GFP_ATOMIC);
if (unlikely(!nskb))
return -ENOMEM;

Expand Down
2 changes: 1 addition & 1 deletion net/ipv4/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ config IP_ADVANCED_ROUTER
rp_filter on use:

echo 1 > /proc/sys/net/ipv4/conf/<device>/rp_filter
and
or
echo 1 > /proc/sys/net/ipv4/conf/all/rp_filter

Note that some distributions enable it in startup scripts.
Expand Down
4 changes: 2 additions & 2 deletions net/irda/af_irda.c
Original file line number Diff line number Diff line change
Expand Up @@ -824,8 +824,8 @@ static int irda_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)

err = irda_open_tsap(self, addr->sir_lsap_sel, addr->sir_name);
if (err < 0) {
kfree(self->ias_obj->name);
kfree(self->ias_obj);
irias_delete_object(self->ias_obj);
self->ias_obj = NULL;
goto out;
}

Expand Down
6 changes: 6 additions & 0 deletions net/mac80211/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -732,6 +732,12 @@ void ieee80211_unregister_hw(struct ieee80211_hw *hw)

rtnl_unlock();

/*
* Now all work items will be gone, but the
* timer might still be armed, so delete it
*/
del_timer_sync(&local->work_timer);

cancel_work_sync(&local->reconfig_filter);

ieee80211_clear_tx_pending(local);
Expand Down
3 changes: 2 additions & 1 deletion net/netfilter/ipvs/ip_vs_ftp.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
#include <linux/netfilter.h>
#include <net/netfilter/nf_conntrack.h>
#include <net/netfilter/nf_conntrack_expect.h>
#include <net/netfilter/nf_nat.h>
#include <net/netfilter/nf_nat_helper.h>
#include <linux/gfp.h>
#include <net/protocol.h>
Expand Down Expand Up @@ -359,7 +360,7 @@ static int ip_vs_ftp_out(struct ip_vs_app *app, struct ip_vs_conn *cp,
buf_len = strlen(buf);

ct = nf_ct_get(skb, &ctinfo);
if (ct && !nf_ct_is_untracked(ct)) {
if (ct && !nf_ct_is_untracked(ct) && nfct_nat(ct)) {
/* If mangling fails this function will return 0
* which will cause the packet to be dropped.
* Mangling can only fail under memory pressure,
Expand Down
22 changes: 22 additions & 0 deletions net/netlink/af_netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -2102,6 +2102,26 @@ static void __net_exit netlink_net_exit(struct net *net)
#endif
}

static void __init netlink_add_usersock_entry(void)
{
unsigned long *listeners;
int groups = 32;

listeners = kzalloc(NLGRPSZ(groups) + sizeof(struct listeners_rcu_head),
GFP_KERNEL);
if (!listeners)
panic("netlink_add_usersock_entry: Cannot allocate listneres\n");

netlink_table_grab();

nl_table[NETLINK_USERSOCK].groups = groups;
nl_table[NETLINK_USERSOCK].listeners = listeners;
nl_table[NETLINK_USERSOCK].module = THIS_MODULE;
nl_table[NETLINK_USERSOCK].registered = 1;

netlink_table_ungrab();
}

static struct pernet_operations __net_initdata netlink_net_ops = {
.init = netlink_net_init,
.exit = netlink_net_exit,
Expand Down Expand Up @@ -2150,6 +2170,8 @@ static int __init netlink_proto_init(void)
hash->rehash_time = jiffies;
}

netlink_add_usersock_entry();

sock_register(&netlink_family_ops);
register_pernet_subsys(&netlink_net_ops);
/* The netlink device handler may be needed early. */
Expand Down
21 changes: 9 additions & 12 deletions net/sched/act_police.c
Original file line number Diff line number Diff line change
Expand Up @@ -350,22 +350,19 @@ tcf_act_police_dump(struct sk_buff *skb, struct tc_action *a, int bind, int ref)
{
unsigned char *b = skb_tail_pointer(skb);
struct tcf_police *police = a->priv;
struct tc_police opt;

opt.index = police->tcf_index;
opt.action = police->tcf_action;
opt.mtu = police->tcfp_mtu;
opt.burst = police->tcfp_burst;
opt.refcnt = police->tcf_refcnt - ref;
opt.bindcnt = police->tcf_bindcnt - bind;
struct tc_police opt = {
.index = police->tcf_index,
.action = police->tcf_action,
.mtu = police->tcfp_mtu,
.burst = police->tcfp_burst,
.refcnt = police->tcf_refcnt - ref,
.bindcnt = police->tcf_bindcnt - bind,
};

if (police->tcfp_R_tab)
opt.rate = police->tcfp_R_tab->rate;
else
memset(&opt.rate, 0, sizeof(opt.rate));
if (police->tcfp_P_tab)
opt.peakrate = police->tcfp_P_tab->rate;
else
memset(&opt.peakrate, 0, sizeof(opt.peakrate));
NLA_PUT(skb, TCA_POLICE_TBF, sizeof(opt), &opt);
if (police->tcfp_result)
NLA_PUT_U32(skb, TCA_POLICE_RESULT, police->tcfp_result);
Expand Down
2 changes: 1 addition & 1 deletion net/sched/sch_hfsc.c
Original file line number Diff line number Diff line change
Expand Up @@ -761,8 +761,8 @@ init_vf(struct hfsc_class *cl, unsigned int len)
if (f != cl->cl_f) {
cl->cl_f = f;
cftree_update(cl);
update_cfmin(cl->cl_parent);
}
update_cfmin(cl->cl_parent);
}
}

Expand Down
21 changes: 12 additions & 9 deletions net/wireless/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -475,12 +475,10 @@ int wiphy_register(struct wiphy *wiphy)
mutex_lock(&cfg80211_mutex);

res = device_add(&rdev->wiphy.dev);
if (res)
goto out_unlock;

res = rfkill_register(rdev->rfkill);
if (res)
goto out_rm_dev;
if (res) {
mutex_unlock(&cfg80211_mutex);
return res;
}

/* set up regulatory info */
wiphy_update_regulatory(wiphy, NL80211_REGDOM_SET_BY_CORE);
Expand Down Expand Up @@ -509,13 +507,18 @@ int wiphy_register(struct wiphy *wiphy)
cfg80211_debugfs_rdev_add(rdev);
mutex_unlock(&cfg80211_mutex);

/*
* due to a locking dependency this has to be outside of the
* cfg80211_mutex lock
*/
res = rfkill_register(rdev->rfkill);
if (res)
goto out_rm_dev;

return 0;

out_rm_dev:
device_del(&rdev->wiphy.dev);

out_unlock:
mutex_unlock(&cfg80211_mutex);
return res;
}
EXPORT_SYMBOL(wiphy_register);
Expand Down
3 changes: 3 additions & 0 deletions net/wireless/wext-compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -1420,6 +1420,9 @@ int cfg80211_wext_giwessid(struct net_device *dev,
{
struct wireless_dev *wdev = dev->ieee80211_ptr;

data->flags = 0;
data->length = 0;

switch (wdev->iftype) {
case NL80211_IFTYPE_ADHOC:
return cfg80211_ibss_wext_giwessid(dev, info, data, ssid);
Expand Down
Loading

0 comments on commit 608307e

Please sign in to comment.