{
struct file * filp;
int error = -EBADF;
- int (*handler)(unsigned int, unsigned int, unsigned long, struct file * filp);
struct ioctl_trans *t;
filp = fget(fd);
while (t && t->cmd != cmd)
t = (struct ioctl_trans *)t->next;
if (t) {
- handler = t->handler;
- error = handler(fd, cmd, arg, filp);
+ if (t->handler)
+ error = t->handler(fd, cmd, arg, filp);
+ else
+ error = sys_ioctl(fd, cmd, arg);
} else if (cmd >= SIOCDEVPRIVATE && cmd <= (SIOCDEVPRIVATE + 15)) {
error = siocdevprivate_ioctl(fd, cmd, arg);
} else {