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:
  netns: fix ip_rt_frag_needed rt_is_expired
  netfilter: nf_conntrack_extend: avoid unnecessary "ct->ext" dereferences
  netfilter: fix double-free and use-after free
  netfilter: arptables in netns for real
  netfilter: ip{,6}tables_security: fix future section mismatch
  selinux: use nf_register_hooks()
  netfilter: ebtables: use nf_register_hooks()
  Revert "pkt_sched: sch_sfq: dump a real number of flows"
  qeth: use dev->ml_priv instead of dev->priv
  syncookies: Make sure ECN is disabled
  net: drop unused BUG_TRAP()
  net: convert BUG_TRAP to generic WARN_ON
  drivers/net: convert BUG_TRAP to generic WARN_ON
  • Loading branch information
Linus Torvalds committed Jul 27, 2008
2 parents 78681ac + 6c3b8fc commit 2284284
Show file tree
Hide file tree
Showing 69 changed files with 293 additions and 282 deletions.
10 changes: 5 additions & 5 deletions drivers/net/bnx2x_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -814,7 +814,7 @@ static u16 bnx2x_free_tx_pkt(struct bnx2x *bp, struct bnx2x_fastpath *fp,
}

/* release skb */
BUG_TRAP(skb);
WARN_ON(!skb);
dev_kfree_skb(skb);
tx_buf->first_bd = 0;
tx_buf->skb = NULL;
Expand All @@ -837,9 +837,9 @@ static inline u16 bnx2x_tx_avail(struct bnx2x_fastpath *fp)
used = SUB_S16(prod, cons) + (s16)NUM_TX_RINGS;

#ifdef BNX2X_STOP_ON_ERROR
BUG_TRAP(used >= 0);
BUG_TRAP(used <= fp->bp->tx_ring_size);
BUG_TRAP((fp->bp->tx_ring_size - used) <= MAX_TX_AVAIL);
WARN_ON(used < 0);
WARN_ON(used > fp->bp->tx_ring_size);
WARN_ON((fp->bp->tx_ring_size - used) > MAX_TX_AVAIL);
#endif

return (s16)(fp->bp->tx_ring_size) - used;
Expand Down Expand Up @@ -4374,7 +4374,7 @@ static void bnx2x_init_rx_rings(struct bnx2x *bp)
}
ring_prod = NEXT_RX_IDX(ring_prod);
cqe_ring_prod = NEXT_RCQ_IDX(cqe_ring_prod);
BUG_TRAP(ring_prod > i);
WARN_ON(ring_prod <= i);
}

fp->rx_bd_prod = ring_prod;
Expand Down
14 changes: 7 additions & 7 deletions drivers/s390/net/qeth_core_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3321,7 +3321,7 @@ int qeth_change_mtu(struct net_device *dev, int new_mtu)
struct qeth_card *card;
char dbf_text[15];

card = netdev_priv(dev);
card = dev->ml_priv;

QETH_DBF_TEXT(TRACE, 4, "chgmtu");
sprintf(dbf_text, "%8x", new_mtu);
Expand All @@ -3343,7 +3343,7 @@ struct net_device_stats *qeth_get_stats(struct net_device *dev)
{
struct qeth_card *card;

card = netdev_priv(dev);
card = dev->ml_priv;

QETH_DBF_TEXT(TRACE, 5, "getstat");

Expand Down Expand Up @@ -3395,15 +3395,15 @@ void qeth_tx_timeout(struct net_device *dev)
{
struct qeth_card *card;

card = netdev_priv(dev);
card = dev->ml_priv;
card->stats.tx_errors++;
qeth_schedule_recovery(card);
}
EXPORT_SYMBOL_GPL(qeth_tx_timeout);

int qeth_mdio_read(struct net_device *dev, int phy_id, int regnum)
{
struct qeth_card *card = netdev_priv(dev);
struct qeth_card *card = dev->ml_priv;
int rc = 0;

switch (regnum) {
Expand Down Expand Up @@ -4253,7 +4253,7 @@ EXPORT_SYMBOL_GPL(qeth_core_get_stats_count);
void qeth_core_get_ethtool_stats(struct net_device *dev,
struct ethtool_stats *stats, u64 *data)
{
struct qeth_card *card = netdev_priv(dev);
struct qeth_card *card = dev->ml_priv;
data[0] = card->stats.rx_packets -
card->perf_stats.initial_rx_packets;
data[1] = card->perf_stats.bufs_rec;
Expand Down Expand Up @@ -4313,7 +4313,7 @@ EXPORT_SYMBOL_GPL(qeth_core_get_strings);
void qeth_core_get_drvinfo(struct net_device *dev,
struct ethtool_drvinfo *info)
{
struct qeth_card *card = netdev_priv(dev);
struct qeth_card *card = dev->ml_priv;
if (card->options.layer2)
strcpy(info->driver, "qeth_l2");
else
Expand All @@ -4331,7 +4331,7 @@ EXPORT_SYMBOL_GPL(qeth_core_get_drvinfo);
int qeth_core_ethtool_get_settings(struct net_device *netdev,
struct ethtool_cmd *ecmd)
{
struct qeth_card *card = netdev_priv(netdev);
struct qeth_card *card = netdev->ml_priv;
enum qeth_link_types link_type;

if ((card->info.type == QETH_CARD_TYPE_IQD) || (card->info.guestlan))
Expand Down
26 changes: 13 additions & 13 deletions drivers/s390/net/qeth_l2_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ static int qeth_l2_recover(void *);

static int qeth_l2_do_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
{
struct qeth_card *card = netdev_priv(dev);
struct qeth_card *card = dev->ml_priv;
struct mii_ioctl_data *mii_data;
int rc = 0;

Expand Down Expand Up @@ -317,7 +317,7 @@ static void qeth_l2_process_vlans(struct qeth_card *card, int clear)

static void qeth_l2_vlan_rx_add_vid(struct net_device *dev, unsigned short vid)
{
struct qeth_card *card = netdev_priv(dev);
struct qeth_card *card = dev->ml_priv;
struct qeth_vlan_vid *id;

QETH_DBF_TEXT_(TRACE, 4, "aid:%d", vid);
Expand All @@ -334,7 +334,7 @@ static void qeth_l2_vlan_rx_add_vid(struct net_device *dev, unsigned short vid)
static void qeth_l2_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid)
{
struct qeth_vlan_vid *id, *tmpid = NULL;
struct qeth_card *card = netdev_priv(dev);
struct qeth_card *card = dev->ml_priv;

QETH_DBF_TEXT_(TRACE, 4, "kid:%d", vid);
spin_lock_bh(&card->vlanlock);
Expand Down Expand Up @@ -566,7 +566,7 @@ static int qeth_l2_request_initial_mac(struct qeth_card *card)
static int qeth_l2_set_mac_address(struct net_device *dev, void *p)
{
struct sockaddr *addr = p;
struct qeth_card *card = netdev_priv(dev);
struct qeth_card *card = dev->ml_priv;
int rc = 0;

QETH_DBF_TEXT(TRACE, 3, "setmac");
Expand All @@ -590,7 +590,7 @@ static int qeth_l2_set_mac_address(struct net_device *dev, void *p)

static void qeth_l2_set_multicast_list(struct net_device *dev)
{
struct qeth_card *card = netdev_priv(dev);
struct qeth_card *card = dev->ml_priv;
struct dev_mc_list *dm;

if (card->info.type == QETH_CARD_TYPE_OSN)
Expand All @@ -612,7 +612,7 @@ static int qeth_l2_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
int rc;
struct qeth_hdr *hdr = NULL;
int elements = 0;
struct qeth_card *card = netdev_priv(dev);
struct qeth_card *card = dev->ml_priv;
struct sk_buff *new_skb = skb;
int ipv = qeth_get_ip_version(skb);
int cast_type = qeth_get_cast_type(card, skb);
Expand Down Expand Up @@ -767,7 +767,7 @@ static void qeth_l2_qdio_input_handler(struct ccw_device *ccwdev,

static int qeth_l2_open(struct net_device *dev)
{
struct qeth_card *card = netdev_priv(dev);
struct qeth_card *card = dev->ml_priv;

QETH_DBF_TEXT(TRACE, 4, "qethopen");
if (card->state != CARD_STATE_SOFTSETUP)
Expand All @@ -791,7 +791,7 @@ static int qeth_l2_open(struct net_device *dev)

static int qeth_l2_stop(struct net_device *dev)
{
struct qeth_card *card = netdev_priv(dev);
struct qeth_card *card = dev->ml_priv;

QETH_DBF_TEXT(TRACE, 4, "qethstop");
netif_tx_disable(dev);
Expand Down Expand Up @@ -838,7 +838,7 @@ static void qeth_l2_remove_device(struct ccwgroup_device *cgdev)

static int qeth_l2_ethtool_set_tso(struct net_device *dev, u32 data)
{
struct qeth_card *card = netdev_priv(dev);
struct qeth_card *card = dev->ml_priv;

if (data) {
if (card->options.large_send == QETH_LARGE_SEND_NO) {
Expand Down Expand Up @@ -894,7 +894,7 @@ static int qeth_l2_setup_netdev(struct qeth_card *card)
if (!card->dev)
return -ENODEV;

card->dev->priv = card;
card->dev->ml_priv = card;
card->dev->tx_timeout = &qeth_tx_timeout;
card->dev->watchdog_timeo = QETH_TX_TIMEOUT;
card->dev->open = qeth_l2_open;
Expand Down Expand Up @@ -1178,7 +1178,7 @@ int qeth_osn_assist(struct net_device *dev, void *data, int data_len)
QETH_DBF_TEXT(TRACE, 2, "osnsdmc");
if (!dev)
return -ENODEV;
card = netdev_priv(dev);
card = dev->ml_priv;
if (!card)
return -ENODEV;
if ((card->state != CARD_STATE_UP) &&
Expand All @@ -1201,7 +1201,7 @@ int qeth_osn_register(unsigned char *read_dev_no, struct net_device **dev,
*dev = qeth_l2_netdev_by_devno(read_dev_no);
if (*dev == NULL)
return -ENODEV;
card = netdev_priv(*dev);
card = (*dev)->ml_priv;
if (!card)
return -ENODEV;
if ((assist_cb == NULL) || (data_cb == NULL))
Expand All @@ -1219,7 +1219,7 @@ void qeth_osn_deregister(struct net_device *dev)
QETH_DBF_TEXT(TRACE, 2, "osndereg");
if (!dev)
return;
card = netdev_priv(dev);
card = dev->ml_priv;
if (!card)
return;
card->osn_info.assist_cb = NULL;
Expand Down
30 changes: 15 additions & 15 deletions drivers/s390/net/qeth_l3_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1813,7 +1813,7 @@ static void qeth_l3_free_vlan_addresses(struct qeth_card *card,
static void qeth_l3_vlan_rx_register(struct net_device *dev,
struct vlan_group *grp)
{
struct qeth_card *card = netdev_priv(dev);
struct qeth_card *card = dev->ml_priv;
unsigned long flags;

QETH_DBF_TEXT(TRACE, 4, "vlanreg");
Expand All @@ -1825,7 +1825,7 @@ static void qeth_l3_vlan_rx_register(struct net_device *dev,
static void qeth_l3_vlan_rx_add_vid(struct net_device *dev, unsigned short vid)
{
struct net_device *vlandev;
struct qeth_card *card = (struct qeth_card *) dev->priv;
struct qeth_card *card = dev->ml_priv;
struct in_device *in_dev;

if (card->info.type == QETH_CARD_TYPE_IQD)
Expand All @@ -1851,7 +1851,7 @@ static void qeth_l3_vlan_rx_add_vid(struct net_device *dev, unsigned short vid)

static void qeth_l3_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid)
{
struct qeth_card *card = netdev_priv(dev);
struct qeth_card *card = dev->ml_priv;
unsigned long flags;

QETH_DBF_TEXT_(TRACE, 4, "kid:%d", vid);
Expand Down Expand Up @@ -2013,7 +2013,7 @@ static int qeth_l3_verify_vlan_dev(struct net_device *dev,
}
}

if (rc && !(netdev_priv(vlan_dev_real_dev(dev)) == (void *)card))
if (rc && !(vlan_dev_real_dev(dev)->ml_priv == (void *)card))
return 0;

return rc;
Expand Down Expand Up @@ -2047,9 +2047,9 @@ static struct qeth_card *qeth_l3_get_card_from_dev(struct net_device *dev)

rc = qeth_l3_verify_dev(dev);
if (rc == QETH_REAL_CARD)
card = netdev_priv(dev);
card = dev->ml_priv;
else if (rc == QETH_VLAN_CARD)
card = netdev_priv(vlan_dev_real_dev(dev));
card = vlan_dev_real_dev(dev)->ml_priv;
if (card && card->options.layer2)
card = NULL;
QETH_DBF_TEXT_(TRACE, 4, "%d", rc);
Expand Down Expand Up @@ -2110,7 +2110,7 @@ static int qeth_l3_stop_card(struct qeth_card *card, int recovery_mode)

static void qeth_l3_set_multicast_list(struct net_device *dev)
{
struct qeth_card *card = netdev_priv(dev);
struct qeth_card *card = dev->ml_priv;

QETH_DBF_TEXT(TRACE, 3, "setmulti");
qeth_l3_delete_mc_addresses(card);
Expand Down Expand Up @@ -2438,7 +2438,7 @@ static int qeth_l3_arp_flush_cache(struct qeth_card *card)

static int qeth_l3_do_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
{
struct qeth_card *card = netdev_priv(dev);
struct qeth_card *card = dev->ml_priv;
struct qeth_arp_cache_entry arp_entry;
struct mii_ioctl_data *mii_data;
int rc = 0;
Expand Down Expand Up @@ -2595,7 +2595,7 @@ static int qeth_l3_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
u16 *tag;
struct qeth_hdr *hdr = NULL;
int elements_needed = 0;
struct qeth_card *card = netdev_priv(dev);
struct qeth_card *card = dev->ml_priv;
struct sk_buff *new_skb = NULL;
int ipv = qeth_get_ip_version(skb);
int cast_type = qeth_get_cast_type(card, skb);
Expand Down Expand Up @@ -2763,7 +2763,7 @@ static int qeth_l3_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)

static int qeth_l3_open(struct net_device *dev)
{
struct qeth_card *card = netdev_priv(dev);
struct qeth_card *card = dev->ml_priv;

QETH_DBF_TEXT(TRACE, 4, "qethopen");
if (card->state != CARD_STATE_SOFTSETUP)
Expand All @@ -2780,7 +2780,7 @@ static int qeth_l3_open(struct net_device *dev)

static int qeth_l3_stop(struct net_device *dev)
{
struct qeth_card *card = netdev_priv(dev);
struct qeth_card *card = dev->ml_priv;

QETH_DBF_TEXT(TRACE, 4, "qethstop");
netif_tx_disable(dev);
Expand All @@ -2792,14 +2792,14 @@ static int qeth_l3_stop(struct net_device *dev)

static u32 qeth_l3_ethtool_get_rx_csum(struct net_device *dev)
{
struct qeth_card *card = netdev_priv(dev);
struct qeth_card *card = dev->ml_priv;

return (card->options.checksum_type == HW_CHECKSUMMING);
}

static int qeth_l3_ethtool_set_rx_csum(struct net_device *dev, u32 data)
{
struct qeth_card *card = netdev_priv(dev);
struct qeth_card *card = dev->ml_priv;
enum qeth_card_states old_state;
enum qeth_checksum_types csum_type;

Expand All @@ -2825,7 +2825,7 @@ static int qeth_l3_ethtool_set_rx_csum(struct net_device *dev, u32 data)

static int qeth_l3_ethtool_set_tso(struct net_device *dev, u32 data)
{
struct qeth_card *card = netdev_priv(dev);
struct qeth_card *card = dev->ml_priv;

if (data) {
if (card->options.large_send == QETH_LARGE_SEND_NO) {
Expand Down Expand Up @@ -2915,7 +2915,7 @@ static int qeth_l3_setup_netdev(struct qeth_card *card)
return -ENODEV;

card->dev->hard_start_xmit = qeth_l3_hard_start_xmit;
card->dev->priv = card;
card->dev->ml_priv = card;
card->dev->tx_timeout = &qeth_tx_timeout;
card->dev->watchdog_timeo = QETH_TX_TIMEOUT;
card->dev->open = qeth_l3_open;
Expand Down
7 changes: 0 additions & 7 deletions include/linux/rtnetlink.h
Original file line number Diff line number Diff line change
Expand Up @@ -755,13 +755,6 @@ extern void __rtnl_unlock(void);
} \
} while(0)

#define BUG_TRAP(x) do { \
if (unlikely(!(x))) { \
printk(KERN_ERR "KERNEL: assertion (%s) failed at %s (%d)\n", \
#x, __FILE__ , __LINE__); \
} \
} while(0)

static inline u32 rtm_get_table(struct rtattr **rta, u8 table)
{
return RTA_GET_U32(rta[RTA_TABLE-1]);
Expand Down
1 change: 1 addition & 0 deletions include/linux/slab.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ int kmem_ptr_validate(struct kmem_cache *cachep, const void *ptr);
/*
* Common kmalloc functions provided by all allocators
*/
void * __must_check __krealloc(const void *, size_t, gfp_t);
void * __must_check krealloc(const void *, size_t, gfp_t);
void kfree(const void *);
size_t ksize(const void *);
Expand Down
5 changes: 3 additions & 2 deletions include/net/request_sock.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <linux/slab.h>
#include <linux/spinlock.h>
#include <linux/types.h>
#include <linux/bug.h>

#include <net/sock.h>

Expand Down Expand Up @@ -170,7 +171,7 @@ static inline struct request_sock *reqsk_queue_remove(struct request_sock_queue
{
struct request_sock *req = queue->rskq_accept_head;

BUG_TRAP(req != NULL);
WARN_ON(req == NULL);

queue->rskq_accept_head = req->dl_next;
if (queue->rskq_accept_head == NULL)
Expand All @@ -185,7 +186,7 @@ static inline struct sock *reqsk_queue_get_child(struct request_sock_queue *queu
struct request_sock *req = reqsk_queue_remove(queue);
struct sock *child = req->sk;

BUG_TRAP(child != NULL);
WARN_ON(child == NULL);

sk_acceptq_removed(parent);
__reqsk_free(req);
Expand Down
Loading

0 comments on commit 2284284

Please sign in to comment.