diff options
Diffstat (limited to 'fs/compat_ioctl.c')
-rw-r--r-- | fs/compat_ioctl.c | 38 |
1 files changed, 2 insertions, 36 deletions
diff --git a/fs/compat_ioctl.c b/fs/compat_ioctl.c index 51352de88ef1..a10e428b32b4 100644 --- a/fs/compat_ioctl.c +++ b/fs/compat_ioctl.c | |||
@@ -1506,35 +1506,6 @@ static long do_ioctl_trans(int fd, unsigned int cmd, | |||
1506 | return -ENOIOCTLCMD; | 1506 | return -ENOIOCTLCMD; |
1507 | } | 1507 | } |
1508 | 1508 | ||
1509 | static void compat_ioctl_error(struct file *filp, unsigned int fd, | ||
1510 | unsigned int cmd, unsigned long arg) | ||
1511 | { | ||
1512 | char buf[10]; | ||
1513 | char *fn = "?"; | ||
1514 | char *path; | ||
1515 | |||
1516 | /* find the name of the device. */ | ||
1517 | path = (char *)__get_free_page(GFP_KERNEL); | ||
1518 | if (path) { | ||
1519 | fn = d_path(&filp->f_path, path, PAGE_SIZE); | ||
1520 | if (IS_ERR(fn)) | ||
1521 | fn = "?"; | ||
1522 | } | ||
1523 | |||
1524 | sprintf(buf,"'%c'", (cmd>>_IOC_TYPESHIFT) & _IOC_TYPEMASK); | ||
1525 | if (!isprint(buf[1])) | ||
1526 | sprintf(buf, "%02x", buf[1]); | ||
1527 | compat_printk("ioctl32(%s:%d): Unknown cmd fd(%d) " | ||
1528 | "cmd(%08x){t:%s;sz:%u} arg(%08x) on %s\n", | ||
1529 | current->comm, current->pid, | ||
1530 | (int)fd, (unsigned int)cmd, buf, | ||
1531 | (cmd >> _IOC_SIZESHIFT) & _IOC_SIZEMASK, | ||
1532 | (unsigned int)arg, fn); | ||
1533 | |||
1534 | if (path) | ||
1535 | free_page((unsigned long)path); | ||
1536 | } | ||
1537 | |||
1538 | static int compat_ioctl_check_table(unsigned int xcmd) | 1509 | static int compat_ioctl_check_table(unsigned int xcmd) |
1539 | { | 1510 | { |
1540 | int i; | 1511 | int i; |
@@ -1621,13 +1592,8 @@ asmlinkage long compat_sys_ioctl(unsigned int fd, unsigned int cmd, | |||
1621 | goto found_handler; | 1592 | goto found_handler; |
1622 | 1593 | ||
1623 | error = do_ioctl_trans(fd, cmd, arg, filp); | 1594 | error = do_ioctl_trans(fd, cmd, arg, filp); |
1624 | if (error == -ENOIOCTLCMD) { | 1595 | if (error == -ENOIOCTLCMD) |
1625 | static int count; | 1596 | error = -ENOTTY; |
1626 | |||
1627 | if (++count <= 50) | ||
1628 | compat_ioctl_error(filp, fd, cmd, arg); | ||
1629 | error = -EINVAL; | ||
1630 | } | ||
1631 | 1597 | ||
1632 | goto out_fput; | 1598 | goto out_fput; |
1633 | 1599 | ||