diff options
author | Søren Schmidt <sos@FreeBSD.org> | 2003-03-27 10:48:21 +0000 |
---|---|---|
committer | Søren Schmidt <sos@FreeBSD.org> | 2003-03-27 10:48:21 +0000 |
commit | c7f547fde8a3351514bdf3071c70f52374740711 (patch) | |
tree | 2c167278c0546ded0ded7c716c5deebb3c1069ba /sys/dev/ata/ata-disk.c | |
parent | 83e13864c3144fe20d37bced6565b5719b62c765 (diff) | |
download | src-c7f547fde8a3351514bdf3071c70f52374740711.tar.gz src-c7f547fde8a3351514bdf3071c70f52374740711.zip |
Biofinish the request if we cannot malloc in ad_start.
Notes
Notes:
svn path=/head/; revision=112703
Diffstat (limited to 'sys/dev/ata/ata-disk.c')
-rw-r--r-- | sys/dev/ata/ata-disk.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/dev/ata/ata-disk.c b/sys/dev/ata/ata-disk.c index 9193c6598234..8523c3368379 100644 --- a/sys/dev/ata/ata-disk.c +++ b/sys/dev/ata/ata-disk.c @@ -356,8 +356,12 @@ ad_start(struct ata_device *atadev) return; } + /* remove request from drive queue */ + bioq_remove(&adp->queue, bp); + if (!(request = malloc(sizeof(struct ad_request), M_AD, M_NOWAIT|M_ZERO))) { ata_prtdev(atadev, "out of memory in start\n"); + biofinish(bp, NULL, ENOMEM); return; } @@ -377,9 +381,6 @@ ad_start(struct ata_device *atadev) /* insert in tag array */ adp->tags[tag] = request; - /* remove from drive queue */ - bioq_remove(&adp->queue, bp); - /* link onto controller queue */ TAILQ_INSERT_TAIL(&atadev->channel->ata_queue, request, chain); } |