diff options
| author | Alfred Perlstein <alfred@FreeBSD.org> | 2002-01-13 11:58:06 +0000 |
|---|---|---|
| committer | Alfred Perlstein <alfred@FreeBSD.org> | 2002-01-13 11:58:06 +0000 |
| commit | 426da3bcfb40b0b0733f0be4dea9e7659f442368 (patch) | |
| tree | 598e20df363e602313c7ad93de8f8c4b4240d61d /sys/dev/tdfx | |
| parent | 12076922ff2c1b5b1f22d92fa4a924ab2757e46d (diff) | |
Notes
Diffstat (limited to 'sys/dev/tdfx')
| -rw-r--r-- | sys/dev/tdfx/tdfx_pci.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/dev/tdfx/tdfx_pci.c b/sys/dev/tdfx/tdfx_pci.c index 5594a13630eb..cfbfe18a0833 100644 --- a/sys/dev/tdfx/tdfx_pci.c +++ b/sys/dev/tdfx/tdfx_pci.c @@ -842,11 +842,15 @@ linux_ioctl_tdfx(struct thread *td, struct linux_ioctl_args* args) and one void*. */ char d_pio[2*sizeof(short) + sizeof(int) + sizeof(void*)]; - struct file *fp = td->td_proc->p_fd->fd_ofiles[args->fd]; + struct file *fp; + fp = ffind_hold(td, args->fd); + if (fp == NULL) + return (EBADF); /* We simply copy the data and send it right to ioctl */ copyin((caddr_t)args->arg, &d_pio, sizeof(d_pio)); error = fo_ioctl(fp, cmd, (caddr_t)&d_pio, td); + fdrop(fp, td); return error; } #endif /* TDFX_LINUX */ |
