Check return value of malloc correctly and use M_ZERO.

This commit is contained in:
David Malone 2000-12-03 13:18:49 +00:00
parent 13f1579a17
commit 0863e00340

View File

@ -407,14 +407,13 @@ labpcinit(void)
if (NLABPC > MAX_UNITS)
return 0;
labpcs = malloc(NLABPC * sizeof(struct ctlr *), M_DEVBUF, M_NOWAIT);
if (labpcs)
{
bzero(labpcs, NLABPC * sizeof(struct ctlr *));
return 1;
}
labpcs = malloc(NLABPC * sizeof(struct ctlr *), M_DEVBUF,
M_NOWAIT | M_ZERO);
if (labpcs == NULL)
return 0;
cdevsw_add(&labpc_cdevsw);
return 0;
return 1;
}
static int