Date: Thu, 11 Jun 2009 18:39:32 +0000 (UTC) From: Andriy Gapon <avg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r194036 - in stable/7/sys: . compat/linux contrib/pf dev/ath/ath_hal Message-ID: <200906111839.n5BIdWat057078@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: avg Date: Thu Jun 11 18:39:31 2009 New Revision: 194036 URL: http://svn.freebsd.org/changeset/base/194036 Log: MFC r192899: linux_ioctl_cdrom: reduce stack usage Approved by: jhb (mentor) Modified: stable/7/sys/ (props changed) stable/7/sys/compat/linux/linux_ioctl.c stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) Modified: stable/7/sys/compat/linux/linux_ioctl.c ============================================================================== --- stable/7/sys/compat/linux/linux_ioctl.c Thu Jun 11 18:32:53 2009 (r194035) +++ stable/7/sys/compat/linux/linux_ioctl.c Thu Jun 11 18:39:31 2009 (r194036) @@ -1539,23 +1539,28 @@ linux_ioctl_cdrom(struct thread *td, str /* 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; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200906111839.n5BIdWat057078>