1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-21 11:13:30 +00:00

Dont alloc size 0 buffers.

This commit is contained in:
Søren Schmidt 2004-02-21 18:30:03 +00:00
parent 73f8099662
commit 056b9907de
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=126074

View File

@ -1590,7 +1590,7 @@ acd_send_cue(struct acd_softc *cdp, struct cdr_cuesheet *cuesheet)
static int
acd_report_key(struct acd_softc *cdp, struct dvd_authinfo *ai)
{
struct dvd_miscauth *d;
struct dvd_miscauth *d = NULL;
u_int32_t lba = 0;
int16_t length;
int8_t ccb[16];
@ -1629,8 +1629,10 @@ acd_report_key(struct acd_softc *cdp, struct dvd_authinfo *ai)
ccb[9] = length & 0xff;
ccb[10] = (ai->agid << 6) | ai->format;
d = malloc(length, M_ACD, M_NOWAIT | M_ZERO);
d->length = htons(length - 2);
if (length) {
d = malloc(length, M_ACD, M_NOWAIT | M_ZERO);
d->length = htons(length - 2);
}
error = ata_atapicmd(cdp->device, ccb, (caddr_t)d, length,
ai->format == DVD_INVALIDATE_AGID ? 0 : ATA_R_READ,10);