diff options
author | sos <sos@FreeBSD.org> | 2004-01-12 09:33:10 +0000 |
---|---|---|
committer | sos <sos@FreeBSD.org> | 2004-01-12 09:33:10 +0000 |
commit | 58a7725eaf7f7f39f8863317d2eacb1174c0ee36 (patch) | |
tree | 225304cc5939c48119f41266b873051fb75634dd | |
parent | 20e731302f5e94c769a9e771cc03119cdda8481f (diff) | |
download | FreeBSD-src-58a7725eaf7f7f39f8863317d2eacb1174c0ee36.zip FreeBSD-src-58a7725eaf7f7f39f8863317d2eacb1174c0ee36.tar.gz |
Always return ENOMEM if ata_request_alloc fails so GEOM can dtrt.
-rw-r--r-- | sys/dev/ata/ata-queue.c | 8 | ||||
-rw-r--r-- | sys/dev/ata/atapi-cd.c | 6 | ||||
-rw-r--r-- | sys/dev/ata/atapi-fd.c | 2 | ||||
-rw-r--r-- | sys/dev/ata/atapi-tape.c | 2 |
4 files changed, 9 insertions, 9 deletions
diff --git a/sys/dev/ata/ata-queue.c b/sys/dev/ata/ata-queue.c index 415d398..aa47437 100644 --- a/sys/dev/ata/ata-queue.c +++ b/sys/dev/ata/ata-queue.c @@ -153,11 +153,11 @@ ata_atapicmd(struct ata_device *atadev, u_int8_t *ccb, caddr_t data, struct ata_request *request = ata_alloc_request(); int packet_size, error = ENOMEM; - if ((atadev->param->config & ATA_PROTO_MASK) == ATA_PROTO_ATAPI_12) - packet_size = 12; - else - packet_size = 16; if (request) { + if ((atadev->param->config & ATA_PROTO_MASK) == ATA_PROTO_ATAPI_12) + packet_size = 12; + else + packet_size = 16; request->device = atadev; bcopy(ccb, request->u.atapi.ccb, packet_size); request->data = data; diff --git a/sys/dev/ata/atapi-cd.c b/sys/dev/ata/atapi-cd.c index 6cdbaea..5d897f9 100644 --- a/sys/dev/ata/atapi-cd.c +++ b/sys/dev/ata/atapi-cd.c @@ -1139,7 +1139,7 @@ acd_start(struct ata_device *atadev) ccb[8] = count; if (!(request = ata_alloc_request())) { - g_io_deliver(bp, EIO); + g_io_deliver(bp, ENOMEM); return; } request->device = atadev; @@ -1335,9 +1335,9 @@ acd_select_slot(struct acd_softc *cdp) cdp->changer_info->current_slot, 0, 0, 0, 0, 0, 0, 0 }; /* unload the current media from player */ - if (!(request = ata_alloc_request())) { + if (!(request = ata_alloc_request())) return; - } + request->device = cdp->device; request->driver = cdp; bcopy(ccb, request->u.atapi.ccb, diff --git a/sys/dev/ata/atapi-fd.c b/sys/dev/ata/atapi-fd.c index 0c0f4ac..4bcafc6 100644 --- a/sys/dev/ata/atapi-fd.c +++ b/sys/dev/ata/atapi-fd.c @@ -344,7 +344,7 @@ afd_start(struct ata_device *atadev) ccb[8] = count; if (!(request = ata_alloc_request())) { - biofinish(bp, NULL, EIO); + biofinish(bp, NULL, ENOMEM); return; } request->device = atadev; diff --git a/sys/dev/ata/atapi-tape.c b/sys/dev/ata/atapi-tape.c index 1a5d6ca..aa01594 100644 --- a/sys/dev/ata/atapi-tape.c +++ b/sys/dev/ata/atapi-tape.c @@ -510,7 +510,7 @@ ast_start(struct ata_device *atadev) ccb[4] = blkcount; if (!(request = ata_alloc_request())) { - biofinish(bp, NULL, EIO); + biofinish(bp, NULL, ENOMEM); return; } request->device = atadev; |