Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 72960
b: refs/heads/master
c: 57eb06e
h: refs/heads/master
v: v3
  • Loading branch information
Linus Torvalds committed Oct 31, 2007
1 parent c7a4b3c commit 7bd98bd
Show file tree
Hide file tree
Showing 24 changed files with 141 additions and 201 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: 558de8a74efe37a4b5e2ef944da17d23e701dd98
refs/heads/master: 57eb06e584be3b702d1ba5c39e0b57ddcdabdc66
5 changes: 1 addition & 4 deletions trunk/drivers/connector/connector.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ static void cn_rx_skb(struct sk_buff *__skb)
skb->len < nlh->nlmsg_len ||
nlh->nlmsg_len > CONNECTOR_MAX_MSG_SIZE) {
kfree_skb(skb);
goto out;
return;
}

len = NLMSG_ALIGN(nlh->nlmsg_len);
Expand All @@ -229,9 +229,6 @@ static void cn_rx_skb(struct sk_buff *__skb)
if (err < 0)
kfree_skb(skb);
}

out:
kfree_skb(__skb);
}

/*
Expand Down
37 changes: 25 additions & 12 deletions trunk/drivers/firewire/fw-ohci.c
Original file line number Diff line number Diff line change
Expand Up @@ -984,8 +984,10 @@ static void bus_reset_tasklet(unsigned long data)
*/

if (ohci->next_config_rom != NULL) {
free_rom = ohci->config_rom;
free_rom_bus = ohci->config_rom_bus;
if (ohci->next_config_rom != ohci->config_rom) {
free_rom = ohci->config_rom;
free_rom_bus = ohci->config_rom_bus;
}
ohci->config_rom = ohci->next_config_rom;
ohci->config_rom_bus = ohci->next_config_rom_bus;
ohci->next_config_rom = NULL;
Expand Down Expand Up @@ -1161,19 +1163,30 @@ static int ohci_enable(struct fw_card *card, u32 *config_rom, size_t length)
* the right values in the bus reset tasklet.
*/

ohci->next_config_rom =
dma_alloc_coherent(ohci->card.device, CONFIG_ROM_SIZE,
&ohci->next_config_rom_bus, GFP_KERNEL);
if (ohci->next_config_rom == NULL)
return -ENOMEM;
if (config_rom) {
ohci->next_config_rom =
dma_alloc_coherent(ohci->card.device, CONFIG_ROM_SIZE,
&ohci->next_config_rom_bus,
GFP_KERNEL);
if (ohci->next_config_rom == NULL)
return -ENOMEM;

memset(ohci->next_config_rom, 0, CONFIG_ROM_SIZE);
fw_memcpy_to_be32(ohci->next_config_rom, config_rom, length * 4);
memset(ohci->next_config_rom, 0, CONFIG_ROM_SIZE);
fw_memcpy_to_be32(ohci->next_config_rom, config_rom, length * 4);
} else {
/*
* In the suspend case, config_rom is NULL, which
* means that we just reuse the old config rom.
*/
ohci->next_config_rom = ohci->config_rom;
ohci->next_config_rom_bus = ohci->config_rom_bus;
}

ohci->next_header = config_rom[0];
ohci->next_header = be32_to_cpu(ohci->next_config_rom[0]);
ohci->next_config_rom[0] = 0;
reg_write(ohci, OHCI1394_ConfigROMhdr, 0);
reg_write(ohci, OHCI1394_BusOptions, config_rom[2]);
reg_write(ohci, OHCI1394_BusOptions,
be32_to_cpu(ohci->next_config_rom[2]));
reg_write(ohci, OHCI1394_ConfigROMmap, ohci->next_config_rom_bus);

reg_write(ohci, OHCI1394_AsReqFilterHiSet, 0x80000000);
Expand Down Expand Up @@ -1984,7 +1997,7 @@ static int pci_resume(struct pci_dev *pdev)
return err;
}

return ohci_enable(&ohci->card, ohci->config_rom, CONFIG_ROM_SIZE);
return ohci_enable(&ohci->card, NULL, 0);
}
#endif

Expand Down
2 changes: 0 additions & 2 deletions trunk/drivers/ieee1394/ieee1394_transactions.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,6 @@ int hpsb_packet_success(struct hpsb_packet *packet)
packet->node_id);
return -EAGAIN;
}
BUG();

case ACK_BUSY_X:
case ACK_BUSY_A:
Expand Down Expand Up @@ -282,7 +281,6 @@ int hpsb_packet_success(struct hpsb_packet *packet)
packet->ack_code, packet->node_id, packet->tcode);
return -EAGAIN;
}
BUG();
}

struct hpsb_packet *hpsb_make_readpacket(struct hpsb_host *host, nodeid_t node,
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/media/video/ivtv/ivtv-i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,7 @@ int __devinit init_ivtv_i2c(struct ivtv *itv)
return i2c_bit_add_bus(&itv->i2c_adap);
}

void __devexit exit_ivtv_i2c(struct ivtv *itv)
void exit_ivtv_i2c(struct ivtv *itv)
{
IVTV_DEBUG_I2C("i2c exit\n");

Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/media/video/ivtv/ivtv-i2c.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ void ivtv_call_i2c_clients(struct ivtv *itv, unsigned int cmd, void *arg);

/* init + register i2c algo-bit adapter */
int __devinit init_ivtv_i2c(struct ivtv *itv);
void __devexit exit_ivtv_i2c(struct ivtv *itv);
void exit_ivtv_i2c(struct ivtv *itv);

#endif
2 changes: 1 addition & 1 deletion trunk/drivers/net/wan/lmc/lmc_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ int lmc_ioctl (struct net_device *dev, struct ifreq *ifr, int cmd) /*fold00*/
sc->lmc_xinfo.Magic1 = 0xDEADBEEF;

if (copy_to_user(ifr->ifr_data, &sc->lmc_xinfo,
sizeof(struct lmc_xinfo))) {
sizeof(struct lmc_xinfo)))
ret = -EFAULT;
else
ret = 0;
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/compat_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ static int dev_ifname32(unsigned int fd, unsigned int cmd, unsigned long arg)
int err;

uifr = compat_alloc_user_space(sizeof(struct ifreq));
if (copy_in_user(uifr, compat_ptr(arg), sizeof(struct ifreq32)));
if (copy_in_user(uifr, compat_ptr(arg), sizeof(struct ifreq32)))
return -EFAULT;

err = sys_ioctl(fd, SIOCGIFNAME, (unsigned long)uifr);
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@ unifdef-y += sonypi.h
unifdef-y += soundcard.h
unifdef-y += stat.h
unifdef-y += stddef.h
unifdef-y += string.h
unifdef-y += synclink.h
unifdef-y += sysctl.h
unifdef-y += tcp.h
Expand Down
12 changes: 3 additions & 9 deletions trunk/include/linux/string.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,14 @@

/* We don't want strings.h stuff being user by user stuff by accident */

#ifdef __KERNEL__
#ifndef __KERNEL__
#include <string.h>
#else

#include <linux/compiler.h> /* for inline */
#include <linux/types.h> /* for size_t */
#include <linux/stddef.h> /* for NULL */

#ifdef __cplusplus
extern "C" {
#endif

extern char *strndup_user(const char __user *, long);

/*
Expand Down Expand Up @@ -111,9 +109,5 @@ extern void *kmemdup(const void *src, size_t len, gfp_t gfp);
extern char **argv_split(gfp_t gfp, const char *str, int *argcp);
extern void argv_free(char **argv);

#ifdef __cplusplus
}
#endif

#endif
#endif /* _LINUX_STRING_H_ */
4 changes: 4 additions & 0 deletions trunk/kernel/sys_ni.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,14 @@ cond_syscall(sys_recvfrom);
cond_syscall(sys_recv);
cond_syscall(sys_socket);
cond_syscall(sys_setsockopt);
cond_syscall(compat_sys_setsockopt);
cond_syscall(sys_getsockopt);
cond_syscall(compat_sys_getsockopt);
cond_syscall(sys_shutdown);
cond_syscall(sys_sendmsg);
cond_syscall(compat_sys_sendmsg);
cond_syscall(sys_recvmsg);
cond_syscall(compat_sys_recvmsg);
cond_syscall(sys_socketcall);
cond_syscall(sys_futex);
cond_syscall(compat_sys_futex);
Expand Down
13 changes: 2 additions & 11 deletions trunk/mm/filemap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1300,7 +1300,7 @@ int filemap_fault(struct vm_area_struct *vma, struct vm_fault *vmf)

size = (i_size_read(inode) + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;
if (vmf->pgoff >= size)
goto outside_data_content;
return VM_FAULT_SIGBUS;

/* If we don't want any read-ahead, don't bother */
if (VM_RandomReadHint(vma))
Expand Down Expand Up @@ -1377,7 +1377,7 @@ int filemap_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
if (unlikely(vmf->pgoff >= size)) {
unlock_page(page);
page_cache_release(page);
goto outside_data_content;
return VM_FAULT_SIGBUS;
}

/*
Expand All @@ -1388,15 +1388,6 @@ int filemap_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
vmf->page = page;
return ret | VM_FAULT_LOCKED;

outside_data_content:
/*
* An external ptracer can access pages that normally aren't
* accessible..
*/
if (vma->vm_mm == current->mm)
return VM_FAULT_SIGBUS;

/* Fall through to the non-read-ahead case */
no_cached_page:
/*
* We're only likely to ever get here if MADV_RANDOM is in
Expand Down
112 changes: 59 additions & 53 deletions trunk/net/core/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -3496,6 +3496,60 @@ static void net_set_todo(struct net_device *dev)
spin_unlock(&net_todo_list_lock);
}

static void rollback_registered(struct net_device *dev)
{
BUG_ON(dev_boot_phase);
ASSERT_RTNL();

/* Some devices call without registering for initialization unwind. */
if (dev->reg_state == NETREG_UNINITIALIZED) {
printk(KERN_DEBUG "unregister_netdevice: device %s/%p never "
"was registered\n", dev->name, dev);

WARN_ON(1);
return;
}

BUG_ON(dev->reg_state != NETREG_REGISTERED);

/* If device is running, close it first. */
dev_close(dev);

/* And unlink it from device chain. */
unlist_netdevice(dev);

dev->reg_state = NETREG_UNREGISTERING;

synchronize_net();

/* Shutdown queueing discipline. */
dev_shutdown(dev);


/* Notify protocols, that we are about to destroy
this device. They should clean all the things.
*/
call_netdevice_notifiers(NETDEV_UNREGISTER, dev);

/*
* Flush the unicast and multicast chains
*/
dev_addr_discard(dev);

if (dev->uninit)
dev->uninit(dev);

/* Notifier chain MUST detach us from master device. */
BUG_TRAP(!dev->master);

/* Remove entries from kobject tree */
netdev_unregister_kobject(dev);

synchronize_net();

dev_put(dev);
}

/**
* register_netdevice - register a network device
* @dev: device to register
Expand Down Expand Up @@ -3633,8 +3687,10 @@ int register_netdevice(struct net_device *dev)
/* Notify protocols, that a new device appeared. */
ret = call_netdevice_notifiers(NETDEV_REGISTER, dev);
ret = notifier_to_errno(ret);
if (ret)
unregister_netdevice(dev);
if (ret) {
rollback_registered(dev);
dev->reg_state = NETREG_UNREGISTERED;
}

out:
return ret;
Expand Down Expand Up @@ -3911,59 +3967,9 @@ void synchronize_net(void)

void unregister_netdevice(struct net_device *dev)
{
BUG_ON(dev_boot_phase);
ASSERT_RTNL();

/* Some devices call without registering for initialization unwind. */
if (dev->reg_state == NETREG_UNINITIALIZED) {
printk(KERN_DEBUG "unregister_netdevice: device %s/%p never "
"was registered\n", dev->name, dev);

WARN_ON(1);
return;
}

BUG_ON(dev->reg_state != NETREG_REGISTERED);

/* If device is running, close it first. */
dev_close(dev);

/* And unlink it from device chain. */
unlist_netdevice(dev);

dev->reg_state = NETREG_UNREGISTERING;

synchronize_net();

/* Shutdown queueing discipline. */
dev_shutdown(dev);


/* Notify protocols, that we are about to destroy
this device. They should clean all the things.
*/
call_netdevice_notifiers(NETDEV_UNREGISTER, dev);

/*
* Flush the unicast and multicast chains
*/
dev_addr_discard(dev);

if (dev->uninit)
dev->uninit(dev);

/* Notifier chain MUST detach us from master device. */
BUG_TRAP(!dev->master);

/* Remove entries from kobject tree */
netdev_unregister_kobject(dev);

rollback_registered(dev);
/* Finish processing unregister after unlock */
net_set_todo(dev);

synchronize_net();

dev_put(dev);
}

/**
Expand Down
2 changes: 2 additions & 0 deletions trunk/net/core/net_namespace.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ static int setup_net(struct net *net)
if (ops->exit)
ops->exit(net);
}

rcu_barrier();
goto out;
}

Expand Down
Loading

0 comments on commit 7bd98bd

Please sign in to comment.