Always return ENOMEM if ata_request_alloc fails so GEOM can dtrt.

This commit is contained in:
Søren Schmidt 2004-01-12 09:33:10 +00:00
parent ab0a016c08
commit 45a0b23e06
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=124419
4 changed files with 9 additions and 9 deletions

View File

@ -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;

View File

@ -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,

View File

@ -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;

View File

@ -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;