diff options
author | James Morris <jmorris@namei.org> | 2009-02-06 01:01:45 +0100 |
---|---|---|
committer | James Morris <jmorris@namei.org> | 2009-02-06 01:01:45 +0100 |
commit | cb5629b10d64a8006622ce3a52bc887d91057d69 (patch) | |
tree | 7c06d8f30783115e3384721046258ce615b129c5 /drivers/net/atp.c | |
parent | TPM: integrity fix (diff) | |
parent | seq_file: fix big-enough lseek() + read() (diff) | |
download | linux-cb5629b10d64a8006622ce3a52bc887d91057d69.tar.xz linux-cb5629b10d64a8006622ce3a52bc887d91057d69.zip |
Merge branch 'master' into next
Conflicts:
fs/namei.c
Manually merged per:
diff --cc fs/namei.c
index 734f2b5,bbc15c2..0000000
--- a/fs/namei.c
+++ b/fs/namei.c
@@@ -860,9 -848,8 +849,10 @@@ static int __link_path_walk(const char
nd->flags |= LOOKUP_CONTINUE;
err = exec_permission_lite(inode);
if (err == -EAGAIN)
- err = vfs_permission(nd, MAY_EXEC);
+ err = inode_permission(nd->path.dentry->d_inode,
+ MAY_EXEC);
+ if (!err)
+ err = ima_path_check(&nd->path, MAY_EXEC);
if (err)
break;
@@@ -1525,14 -1506,9 +1509,14 @@@ int may_open(struct path *path, int acc
flag &= ~O_TRUNC;
}
- error = vfs_permission(nd, acc_mode);
+ error = inode_permission(inode, acc_mode);
if (error)
return error;
+
- error = ima_path_check(&nd->path,
++ error = ima_path_check(path,
+ acc_mode & (MAY_READ | MAY_WRITE | MAY_EXEC));
+ if (error)
+ return error;
/*
* An append-only file must be opened in append mode for writing.
*/
Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'drivers/net/atp.c')
-rw-r--r-- | drivers/net/atp.c | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/drivers/net/atp.c b/drivers/net/atp.c index ea493ce23982..4317b3edb3d7 100644 --- a/drivers/net/atp.c +++ b/drivers/net/atp.c @@ -204,8 +204,7 @@ static irqreturn_t atp_interrupt(int irq, void *dev_id); static void net_rx(struct net_device *dev); static void read_block(long ioaddr, int length, unsigned char *buffer, int data_mode); static int net_close(struct net_device *dev); -static void set_rx_mode_8002(struct net_device *dev); -static void set_rx_mode_8012(struct net_device *dev); +static void set_rx_mode(struct net_device *dev); static void tx_timeout(struct net_device *dev); @@ -242,6 +241,17 @@ static int __init atp_init(void) return -ENODEV; } +static const struct net_device_ops atp_netdev_ops = { + .ndo_open = net_open, + .ndo_stop = net_close, + .ndo_start_xmit = atp_send_packet, + .ndo_set_multicast_list = set_rx_mode, + .ndo_tx_timeout = tx_timeout, + .ndo_change_mtu = eth_change_mtu, + .ndo_set_mac_address = eth_mac_addr, + .ndo_validate_addr = eth_validate_addr, +}; + static int __init atp_probe1(long ioaddr) { struct net_device *dev = NULL; @@ -342,12 +352,7 @@ static int __init atp_probe1(long ioaddr) if (dev->mem_end & 0xf) net_debug = dev->mem_end & 7; - dev->open = net_open; - dev->stop = net_close; - dev->hard_start_xmit = atp_send_packet; - dev->set_multicast_list = - lp->chip_type == RTL8002 ? &set_rx_mode_8002 : &set_rx_mode_8012; - dev->tx_timeout = tx_timeout; + dev->netdev_ops = &atp_netdev_ops; dev->watchdog_timeo = TX_TIMEOUT; res = register_netdev(dev); @@ -903,6 +908,17 @@ static void set_rx_mode_8012(struct net_device *dev) write_reg(ioaddr, CMR2, CMR2_IRQOUT); /* Switch back to page 0 */ } +static void set_rx_mode(struct net_device *dev) +{ + struct net_local *lp = netdev_priv(dev); + + if (lp->chip_type == RTL8002) + return set_rx_mode_8002(dev); + else + return set_rx_mode_8012(dev); +} + + static int __init atp_init_module(void) { if (debug) /* Emit version even if no cards detected. */ printk(KERN_INFO "%s", version); |