Skip to content

Commit

Permalink
Merge of rsync://rsync.kernel.org/pub/scm/linux/kernel/git/davem/net-…
Browse files Browse the repository at this point in the history
…2.6.git/
  • Loading branch information
Linus Torvalds committed May 4, 2005
2 parents 84e48b6 + 14d50e7 commit 8800cea
Show file tree
Hide file tree
Showing 39 changed files with 402 additions and 291 deletions.
6 changes: 2 additions & 4 deletions drivers/net/ppp_deflate.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,7 @@ static void z_comp_free(void *arg)

if (state) {
zlib_deflateEnd(&state->strm);
if (state->strm.workspace)
vfree(state->strm.workspace);
vfree(state->strm.workspace);
kfree(state);
}
}
Expand Down Expand Up @@ -308,8 +307,7 @@ static void z_decomp_free(void *arg)

if (state) {
zlib_inflateEnd(&state->strm);
if (state->strm.workspace)
kfree(state->strm.workspace);
kfree(state->strm.workspace);
kfree(state);
}
}
Expand Down
12 changes: 4 additions & 8 deletions drivers/net/ppp_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -2467,14 +2467,10 @@ static void ppp_destroy_interface(struct ppp *ppp)
skb_queue_purge(&ppp->mrq);
#endif /* CONFIG_PPP_MULTILINK */
#ifdef CONFIG_PPP_FILTER
if (ppp->pass_filter) {
kfree(ppp->pass_filter);
ppp->pass_filter = NULL;
}
if (ppp->active_filter) {
kfree(ppp->active_filter);
ppp->active_filter = NULL;
}
kfree(ppp->pass_filter);
ppp->pass_filter = NULL;
kfree(ppp->active_filter);
ppp->active_filter = NULL;
#endif /* CONFIG_PPP_FILTER */

kfree(ppp);
Expand Down
8 changes: 2 additions & 6 deletions drivers/net/wan/cycx_x25.c
Original file line number Diff line number Diff line change
Expand Up @@ -436,9 +436,7 @@ static int cycx_wan_new_if(struct wan_device *wandev, struct net_device *dev,
}

if (err) {
if (chan->local_addr)
kfree(chan->local_addr);

kfree(chan->local_addr);
kfree(chan);
return err;
}
Expand All @@ -458,9 +456,7 @@ static int cycx_wan_del_if(struct wan_device *wandev, struct net_device *dev)
struct cycx_x25_channel *chan = dev->priv;

if (chan->svc) {
if (chan->local_addr)
kfree(chan->local_addr);

kfree(chan->local_addr);
if (chan->state == WAN_CONNECTED)
del_timer(&chan->timer);
}
Expand Down
27 changes: 11 additions & 16 deletions drivers/net/wan/pc300_tty.c
Original file line number Diff line number Diff line change
Expand Up @@ -400,10 +400,8 @@ static void cpc_tty_close(struct tty_struct *tty, struct file *flip)
cpc_tty->buf_rx.last = NULL;
}

if (cpc_tty->buf_tx) {
kfree(cpc_tty->buf_tx);
cpc_tty->buf_tx = NULL;
}
kfree(cpc_tty->buf_tx);
cpc_tty->buf_tx = NULL;

CPC_TTY_DBG("%s: TTY closed\n",cpc_tty->name);

Expand Down Expand Up @@ -666,7 +664,7 @@ static void cpc_tty_rx_work(void * data)
unsigned long port;
int i, j;
st_cpc_tty_area *cpc_tty;
volatile st_cpc_rx_buf * buf;
volatile st_cpc_rx_buf *buf;
char flags=0,flg_rx=1;
struct tty_ldisc *ld;

Expand All @@ -680,9 +678,9 @@ static void cpc_tty_rx_work(void * data)
cpc_tty = &cpc_tty_area[port];

if ((buf=cpc_tty->buf_rx.first) != 0) {
if(cpc_tty->tty) {
if (cpc_tty->tty) {
ld = tty_ldisc_ref(cpc_tty->tty);
if(ld) {
if (ld) {
if (ld->receive_buf) {
CPC_TTY_DBG("%s: call line disc. receive_buf\n",cpc_tty->name);
ld->receive_buf(cpc_tty->tty, (char *)(buf->data), &flags, buf->size);
Expand All @@ -691,7 +689,7 @@ static void cpc_tty_rx_work(void * data)
}
}
cpc_tty->buf_rx.first = cpc_tty->buf_rx.first->next;
kfree((unsigned char *)buf);
kfree(buf);
buf = cpc_tty->buf_rx.first;
flg_rx = 1;
}
Expand Down Expand Up @@ -733,7 +731,7 @@ static void cpc_tty_rx_disc_frame(pc300ch_t *pc300chan)

void cpc_tty_receive(pc300dev_t *pc300dev)
{
st_cpc_tty_area *cpc_tty;
st_cpc_tty_area *cpc_tty;
pc300ch_t *pc300chan = (pc300ch_t *)pc300dev->chan;
pc300_t *card = (pc300_t *)pc300chan->card;
int ch = pc300chan->channel;
Expand All @@ -742,7 +740,7 @@ void cpc_tty_receive(pc300dev_t *pc300dev)
int rx_len, rx_aux;
volatile unsigned char status;
unsigned short first_bd = pc300chan->rx_first_bd;
st_cpc_rx_buf *new=NULL;
st_cpc_rx_buf *new = NULL;
unsigned char dsr_rx;

if (pc300dev->cpc_tty == NULL) {
Expand All @@ -762,7 +760,7 @@ void cpc_tty_receive(pc300dev_t *pc300dev)
if (status & DST_EOM) {
break;
}
ptdescr=(pcsca_bd_t __iomem *)(card->hw.rambase+cpc_readl(&ptdescr->next));
ptdescr = (pcsca_bd_t __iomem *)(card->hw.rambase+cpc_readl(&ptdescr->next));
}

if (!rx_len) {
Expand All @@ -771,10 +769,7 @@ void cpc_tty_receive(pc300dev_t *pc300dev)
cpc_writel(card->hw.scabase + DRX_REG(EDAL, ch),
RX_BD_ADDR(ch, pc300chan->rx_last_bd));
}
if (new) {
kfree(new);
new = NULL;
}
kfree(new);
return;
}

Expand All @@ -787,7 +782,7 @@ void cpc_tty_receive(pc300dev_t *pc300dev)
continue;
}

new = (st_cpc_rx_buf *) kmalloc(rx_len + sizeof(st_cpc_rx_buf), GFP_ATOMIC);
new = (st_cpc_rx_buf *)kmalloc(rx_len + sizeof(st_cpc_rx_buf), GFP_ATOMIC);
if (new == 0) {
cpc_tty_rx_disc_frame(pc300chan);
continue;
Expand Down
13 changes: 4 additions & 9 deletions drivers/net/wan/sdla_chdlc.c
Original file line number Diff line number Diff line change
Expand Up @@ -3664,15 +3664,10 @@ static void wanpipe_tty_close(struct tty_struct *tty, struct file * filp)
chdlc_disable_comm_shutdown(card);
unlock_adapter_irq(&card->wandev.lock,&smp_flags);

if (card->tty_buf){
kfree(card->tty_buf);
card->tty_buf=NULL;
}

if (card->tty_rx){
kfree(card->tty_rx);
card->tty_rx=NULL;
}
kfree(card->tty_buf);
card->tty_buf = NULL;
kfree(card->tty_rx);
card->tty_rx = NULL;
}
return;
}
Expand Down
20 changes: 6 additions & 14 deletions drivers/net/wan/x25_asy.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,9 @@ static struct x25_asy *x25_asy_alloc(void)
static void x25_asy_free(struct x25_asy *sl)
{
/* Free all X.25 frame buffers. */
if (sl->rbuff) {
kfree(sl->rbuff);
}
kfree(sl->rbuff);
sl->rbuff = NULL;
if (sl->xbuff) {
kfree(sl->xbuff);
}
kfree(sl->xbuff);
sl->xbuff = NULL;

if (!test_and_clear_bit(SLF_INUSE, &sl->flags)) {
Expand All @@ -134,10 +130,8 @@ static int x25_asy_change_mtu(struct net_device *dev, int newmtu)
{
printk("%s: unable to grow X.25 buffers, MTU change cancelled.\n",
dev->name);
if (xbuff != NULL)
kfree(xbuff);
if (rbuff != NULL)
kfree(rbuff);
kfree(xbuff);
kfree(rbuff);
return -ENOMEM;
}

Expand Down Expand Up @@ -169,10 +163,8 @@ static int x25_asy_change_mtu(struct net_device *dev, int newmtu)

spin_unlock_bh(&sl->lock);

if (xbuff != NULL)
kfree(xbuff);
if (rbuff != NULL)
kfree(rbuff);
kfree(xbuff);
kfree(rbuff);
return 0;
}

Expand Down
8 changes: 6 additions & 2 deletions include/linux/rtnetlink.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,14 @@ enum {
RTM_GETANYCAST = 62,
#define RTM_GETANYCAST RTM_GETANYCAST

RTM_MAX,
#define RTM_MAX RTM_MAX
__RTM_MAX,
#define RTM_MAX (((__RTM_MAX + 3) & ~3) - 1)
};

#define RTM_NR_MSGTYPES (RTM_MAX + 1 - RTM_BASE)
#define RTM_NR_FAMILIES (RTM_NR_MSGTYPES >> 2)
#define RTM_FAM(cmd) (((cmd) - RTM_BASE) >> 2)

/*
Generic structure for encapsulation of optional route information.
It is reminiscent of sockaddr, but with sa_family replaced
Expand Down
5 changes: 4 additions & 1 deletion include/linux/xfrm.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,11 @@ enum {
XFRM_MSG_FLUSHPOLICY,
#define XFRM_MSG_FLUSHPOLICY XFRM_MSG_FLUSHPOLICY

XFRM_MSG_MAX
__XFRM_MSG_MAX
};
#define XFRM_MSG_MAX (__XFRM_MSG_MAX - 1)

#define XFRM_NR_MSGTYPES (XFRM_MSG_MAX + 1 - XFRM_MSG_BASE)

struct xfrm_user_tmpl {
struct xfrm_id id;
Expand Down
1 change: 1 addition & 0 deletions include/net/addrconf.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ struct prefix_info {
#include <linux/in6.h>
#include <linux/netdevice.h>
#include <net/if_inet6.h>
#include <net/ipv6.h>

#define IN6_ADDR_HSIZE 16

Expand Down
3 changes: 2 additions & 1 deletion include/net/pkt_sched.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,8 @@ psched_tod_diff(int delta_sec, int bound)
case 1: \
__delta += 1000000; \
case 0: \
__delta = abs(__delta); \
if (__delta > bound || __delta < 0) \
__delta = bound; \
} \
__delta; \
})
Expand Down
10 changes: 10 additions & 0 deletions include/net/xfrm.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#ifndef _NET_XFRM_H
#define _NET_XFRM_H

#include <linux/compiler.h>
#include <linux/xfrm.h>
#include <linux/spinlock.h>
#include <linux/list.h>
Expand Down Expand Up @@ -516,6 +517,15 @@ struct xfrm_dst
u32 child_mtu_cached;
};

static inline void xfrm_dst_destroy(struct xfrm_dst *xdst)
{
dst_release(xdst->route);
if (likely(xdst->u.dst.xfrm))
xfrm_state_put(xdst->u.dst.xfrm);
}

extern void xfrm_dst_ifdown(struct dst_entry *dst, struct net_device *dev);

/* Decapsulation state, used by the input to store data during
* decapsulation procedure, to be used later (during the policy
* check
Expand Down
19 changes: 8 additions & 11 deletions kernel/audit.c
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ static int audit_receive_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
/* Get message from skb (based on rtnetlink_rcv_skb). Each message is
* processed by audit_receive_msg. Malformed skbs with wrong length are
* discarded silently. */
static int audit_receive_skb(struct sk_buff *skb)
static void audit_receive_skb(struct sk_buff *skb)
{
int err;
struct nlmsghdr *nlh;
Expand All @@ -436,7 +436,7 @@ static int audit_receive_skb(struct sk_buff *skb)
while (skb->len >= NLMSG_SPACE(0)) {
nlh = (struct nlmsghdr *)skb->data;
if (nlh->nlmsg_len < sizeof(*nlh) || skb->len < nlh->nlmsg_len)
return 0;
return;
rlen = NLMSG_ALIGN(nlh->nlmsg_len);
if (rlen > skb->len)
rlen = skb->len;
Expand All @@ -446,23 +446,20 @@ static int audit_receive_skb(struct sk_buff *skb)
netlink_ack(skb, nlh, 0);
skb_pull(skb, rlen);
}
return 0;
}

/* Receive messages from netlink socket. */
static void audit_receive(struct sock *sk, int length)
{
struct sk_buff *skb;
unsigned int qlen;

if (down_trylock(&audit_netlink_sem))
return;
down(&audit_netlink_sem);

/* FIXME: this must not cause starvation */
while ((skb = skb_dequeue(&sk->sk_receive_queue))) {
if (audit_receive_skb(skb) && skb->len)
skb_queue_head(&sk->sk_receive_queue, skb);
else
kfree_skb(skb);
for (qlen = skb_queue_len(&sk->sk_receive_queue); qlen; qlen--) {
skb = skb_dequeue(&sk->sk_receive_queue);
audit_receive_skb(skb);
kfree_skb(skb);
}
up(&audit_netlink_sem);
}
Expand Down
7 changes: 7 additions & 0 deletions net/core/link_watch.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include <linux/netdevice.h>
#include <linux/if.h>
#include <net/sock.h>
#include <net/pkt_sched.h>
#include <linux/rtnetlink.h>
#include <linux/jiffies.h>
#include <linux/spinlock.h>
Expand Down Expand Up @@ -74,6 +75,12 @@ void linkwatch_run_queue(void)
clear_bit(__LINK_STATE_LINKWATCH_PENDING, &dev->state);

if (dev->flags & IFF_UP) {
if (netif_carrier_ok(dev)) {
WARN_ON(dev->qdisc_sleeping == &noop_qdisc);
dev_activate(dev);
} else
dev_deactivate(dev);

netdev_state_change(dev);
}

Expand Down
17 changes: 2 additions & 15 deletions net/core/netfilter.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,21 +217,10 @@ void nf_debug_ip_local_deliver(struct sk_buff *skb)
* NF_IP_RAW_INPUT and NF_IP_PRE_ROUTING. */
if (!skb->dev) {
printk("ip_local_deliver: skb->dev is NULL.\n");
}
else if (strcmp(skb->dev->name, "lo") == 0) {
if (skb->nf_debug != ((1 << NF_IP_LOCAL_OUT)
| (1 << NF_IP_POST_ROUTING)
| (1 << NF_IP_PRE_ROUTING)
| (1 << NF_IP_LOCAL_IN))) {
printk("ip_local_deliver: bad loopback skb: ");
debug_print_hooks_ip(skb->nf_debug);
nf_dump_skb(PF_INET, skb);
}
}
else {
} else {
if (skb->nf_debug != ((1<<NF_IP_PRE_ROUTING)
| (1<<NF_IP_LOCAL_IN))) {
printk("ip_local_deliver: bad non-lo skb: ");
printk("ip_local_deliver: bad skb: ");
debug_print_hooks_ip(skb->nf_debug);
nf_dump_skb(PF_INET, skb);
}
Expand All @@ -247,8 +236,6 @@ void nf_debug_ip_loopback_xmit(struct sk_buff *newskb)
debug_print_hooks_ip(newskb->nf_debug);
nf_dump_skb(PF_INET, newskb);
}
/* Clear to avoid confusing input check */
newskb->nf_debug = 0;
}

void nf_debug_ip_finish_output2(struct sk_buff *skb)
Expand Down
Loading

0 comments on commit 8800cea

Please sign in to comment.