summaryrefslogtreecommitdiffstats
path: root/sys/dev/aac/aac.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/aac/aac.c')
-rw-r--r--sys/dev/aac/aac.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/dev/aac/aac.c b/sys/dev/aac/aac.c
index 42e3697..f456f3f 100644
--- a/sys/dev/aac/aac.c
+++ b/sys/dev/aac/aac.c
@@ -2576,16 +2576,21 @@ aac_linux_ioctl(struct thread *td, struct linux_ioctl_args *args)
{
struct file *fp;
u_long cmd;
+ int error;
debug_called(2);
- fp = td->td_proc->p_fd->fd_ofiles[args->fd];
+ fp = ffind_hold(td, args->fd);
+ if (fp == NULL)
+ return (EBADF);
cmd = args->cmd;
/*
* Pass the ioctl off to our standard handler.
*/
- return(fo_ioctl(fp, cmd, (caddr_t)args->arg, td));
+ error = (fo_ioctl(fp, cmd, (caddr_t)args->arg, td));
+ fdrop(fp, td);
+ return (error);
}
#endif
OpenPOWER on IntegriCloud