Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

hippi: use ndo_siocdevprivate

The rr_ioctl uses private ioctl commands that correctly pass
all data through ifr_data, which works fine in compat mode.

Change it to use ndo_siocdevprivate as a cleanup.

Cc: Jes Sorensen <jes@trained-monkey.org>
Cc: linux-hippi@sunsite.dk
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Arnd Bergmann and committed by
David S. Miller
81a68110 3e7a1c7c

+8 -6
+6 -5
drivers/net/hippi/rrunner.c
··· 63 63 static const struct net_device_ops rr_netdev_ops = { 64 64 .ndo_open = rr_open, 65 65 .ndo_stop = rr_close, 66 - .ndo_do_ioctl = rr_ioctl, 66 + .ndo_siocdevprivate = rr_siocdevprivate, 67 67 .ndo_start_xmit = rr_start_xmit, 68 68 .ndo_set_mac_address = hippi_mac_addr, 69 69 }; ··· 1568 1568 } 1569 1569 1570 1570 1571 - static int rr_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) 1571 + static int rr_siocdevprivate(struct net_device *dev, struct ifreq *rq, 1572 + void __user *data, int cmd) 1572 1573 { 1573 1574 struct rr_private *rrpriv; 1574 1575 unsigned char *image, *oldimage; ··· 1604 1603 error = -EFAULT; 1605 1604 goto gf_out; 1606 1605 } 1607 - error = copy_to_user(rq->ifr_data, image, EEPROM_BYTES); 1606 + error = copy_to_user(data, image, EEPROM_BYTES); 1608 1607 if (error) 1609 1608 error = -EFAULT; 1610 1609 gf_out: ··· 1616 1615 return -EPERM; 1617 1616 } 1618 1617 1619 - image = memdup_user(rq->ifr_data, EEPROM_BYTES); 1618 + image = memdup_user(data, EEPROM_BYTES); 1620 1619 if (IS_ERR(image)) 1621 1620 return PTR_ERR(image); 1622 1621 ··· 1659 1658 return error; 1660 1659 1661 1660 case SIOCRRID: 1662 - return put_user(0x52523032, (int __user *)rq->ifr_data); 1661 + return put_user(0x52523032, (int __user *)data); 1663 1662 default: 1664 1663 return error; 1665 1664 }
+2 -1
drivers/net/hippi/rrunner.h
··· 835 835 static netdev_tx_t rr_start_xmit(struct sk_buff *skb, 836 836 struct net_device *dev); 837 837 static int rr_close(struct net_device *dev); 838 - static int rr_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); 838 + static int rr_siocdevprivate(struct net_device *dev, struct ifreq *rq, 839 + void __user *data, int cmd); 839 840 static unsigned int rr_read_eeprom(struct rr_private *rrpriv, 840 841 unsigned long offset, 841 842 unsigned char *buf,