diff options
| author | Søren Schmidt <sos@FreeBSD.org> | 2000-08-16 07:09:04 +0000 |
|---|---|---|
| committer | Søren Schmidt <sos@FreeBSD.org> | 2000-08-16 07:09:04 +0000 |
| commit | b0bb0aeb95c06983727b7469d5df46782e0bd636 (patch) | |
| tree | ed5566ae9381a94d1c38a57ecd01300a198f3ed6 /sys/dev/ata/atapi-cd.c | |
| parent | 2c15efcfb5882670c84e21533a778d32bfeb25cc (diff) | |
Notes
Diffstat (limited to 'sys/dev/ata/atapi-cd.c')
| -rw-r--r-- | sys/dev/ata/atapi-cd.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/dev/ata/atapi-cd.c b/sys/dev/ata/atapi-cd.c index 64325060eebe..6970e70fcb5e 100644 --- a/sys/dev/ata/atapi-cd.c +++ b/sys/dev/ata/atapi-cd.c @@ -145,7 +145,8 @@ acdattach(struct atapi_softc *atp) chp = malloc(sizeof(struct changer), M_ACD, M_NOWAIT); if (chp == NULL) { printf("acd: out of memory\n"); - return 0; + free(cdp, M_ACD); + return -1; } bzero(chp, sizeof(struct changer)); error = atapi_queue_cmd(cdp->atp, ccb, chp, sizeof(struct changer), @@ -161,6 +162,8 @@ acdattach(struct atapi_softc *atp) if (!(cdparr = malloc(sizeof(struct acd_softc) * chp->slots, M_ACD, M_NOWAIT))) { printf("acd: out of memory\n"); + free(chp, M_ACD); + free(cdp, M_ACD); return -1; } for (count = 0; count < chp->slots; count++) { @@ -168,7 +171,7 @@ acdattach(struct atapi_softc *atp) tmpcdp = acd_init_lun(atp, cdp->stats); if (!tmpcdp) { printf("acd: out of memory\n"); - return -1; + break; } } cdparr[count] = tmpcdp; |
