fix complie error, tested, booted, used
On 7/30/09, Alexander Motin <[email protected]> wrote:
> Author: mav
> Date: Thu Jul 30 13:19:12 2009
> New Revision: 195973
> URL: http://svn.freebsd.org/changeset/base/195973
>
> Log:
> MFC rev. 195724:
>
> Limit IOCATAREQUEST ioctl data size to controller's maximum I/O size.
> It fixes kernel panic when requested size is too large (0xffffffff).
>
> PR: kern/136726
>
> Modified:
> stable/7/sys/ (props changed)
> stable/7/sys/contrib/pf/ (props changed)
> stable/7/sys/dev/ata/ata-all.c
>
> Modified: stable/7/sys/dev/ata/ata-all.c
> ==============================================================================
> --- stable/7/sys/dev/ata/ata-all.c Thu Jul 30 12:41:19 2009
> (r195972)
> +++ stable/7/sys/dev/ata/ata-all.c Thu Jul 30 13:19:12 2009
> (r195973)
> @@ -440,6 +440,7 @@ int
> ata_device_ioctl(device_t dev, u_long cmd, caddr_t data)
> {
> struct ata_device *atadev = device_get_softc(dev);
> + struct ata_channel *ch = device_get_softc(device_get_parent(dev));
> struct ata_ioc_request *ioc_request = (struct ata_ioc_request *)data;
> struct ata_params *params = (struct ata_params *)data;
> int *mode = (int *)data;
> @@ -449,6 +450,10 @@ ata_device_ioctl(device_t dev, u_long cm
>
> switch (cmd) {
> case IOCATAREQUEST:
> + if (ioc_request->count >
> + (ch->dma.max_iosize ? ch->dma.max_iosize : DFLTPHYS)) {
> + return (EFBIG);
> + }
> if (!(buf = malloc(ioc_request->count, M_ATA, M_NOWAIT))) {
> return ENOMEM;
> }
> _______________________________________________
> [email protected] mailing list
> http://lists.freebsd.org/mailman/listinfo/svn-src-stable-7
> To unsubscribe, send any mail to "[email protected]"
>
commit 5f4920b91e91514099d1a321e7ed8270076021b5
Author: opv <[email protected]>
Date: Fri Jul 31 05:56:23 2009 +0200
ata complie fix - was svn commit: r195973 fix
/usr/src/sys/dev/ata/ata-all.c: In function 'ata_device_ioctl':
/usr/src/sys/dev/ata/ata-all.c:454: error: request for member 'max_iosize'
in something not a structure or union
Signed-off-by: Oliver Pinter <[email protected]>
diff --git a/sys/dev/ata/ata-all.c b/sys/dev/ata/ata-all.c
index c58e675..79e0bc4 100644
--- a/sys/dev/ata/ata-all.c
+++ b/sys/dev/ata/ata-all.c
@@ -451,7 +451,7 @@ ata_device_ioctl(device_t dev, u_long cmd, caddr_t data)
switch (cmd) {
case IOCATAREQUEST:
if (ioc_request->count >
- (ch->dma.max_iosize ? ch->dma.max_iosize : DFLTPHYS)) {
+ (ch->dma->max_iosize ? ch->dma->max_iosize : DFLTPHYS)) {
return (EFBIG);
}
if (!(buf = malloc(ioc_request->count, M_ATA, M_NOWAIT))) {
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"