diff options
| author | Andriy Gapon <avg@FreeBSD.org> | 2009-05-27 15:23:12 +0000 |
|---|---|---|
| committer | Andriy Gapon <avg@FreeBSD.org> | 2009-05-27 15:23:12 +0000 |
| commit | 93f0eafde320e95e20950af79dcad474ba9f9450 (patch) | |
| tree | 00acc308d5b1470db5492a755b03fd6207d272f7 | |
| parent | ee1c1433e35693e7b48de84d1894626a45ad1b4f (diff) | |
Notes
| -rw-r--r-- | sys/compat/linux/linux_ioctl.c | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/sys/compat/linux/linux_ioctl.c b/sys/compat/linux/linux_ioctl.c index 2b4ca75834f26..f0a7559578c1a 100644 --- a/sys/compat/linux/linux_ioctl.c +++ b/sys/compat/linux/linux_ioctl.c @@ -1556,23 +1556,28 @@ linux_ioctl_cdrom(struct thread *td, struct linux_ioctl_args *args) /* LINUX_CDROMAUDIOBUFSIZ */ case LINUX_DVD_READ_STRUCT: { - l_dvd_struct lds; - struct dvd_struct bds; + l_dvd_struct *lds; + struct dvd_struct *bds; - error = copyin((void *)args->arg, &lds, sizeof(lds)); + lds = malloc(sizeof(*lds), M_LINUX, M_WAITOK); + bds = malloc(sizeof(*bds), M_LINUX, M_WAITOK); + error = copyin((void *)args->arg, lds, sizeof(*lds)); if (error) - break; - error = linux_to_bsd_dvd_struct(&lds, &bds); + goto out; + error = linux_to_bsd_dvd_struct(lds, bds); if (error) - break; - error = fo_ioctl(fp, DVDIOCREADSTRUCTURE, (caddr_t)&bds, + goto out; + error = fo_ioctl(fp, DVDIOCREADSTRUCTURE, (caddr_t)bds, td->td_ucred, td); if (error) - break; - error = bsd_to_linux_dvd_struct(&bds, &lds); + goto out; + error = bsd_to_linux_dvd_struct(bds, lds); if (error) - break; - error = copyout(&lds, (void *)args->arg, sizeof(lds)); + goto out; + error = copyout(lds, (void *)args->arg, sizeof(*lds)); + out: + free(bds, M_LINUX); + free(lds, M_LINUX); break; } |
