Remove NULL checks after M_WAITOK allocations from nand(4).
MFC after: 1 month
This commit is contained in:
parent
0b7d27d494
commit
055cc05349
@ -228,8 +228,6 @@ generic_nand_attach(device_t dev)
|
||||
if (ivar->is_onfi) {
|
||||
onfi_chip_params = malloc(sizeof(struct onfi_chip_params),
|
||||
M_NAND, M_WAITOK | M_ZERO);
|
||||
if (onfi_chip_params == NULL)
|
||||
return (ENOMEM);
|
||||
|
||||
if (onfi_read_parameter(chip, onfi_chip_params)) {
|
||||
nand_debug(NDBG_GEN,"Could not read parameter page!\n");
|
||||
@ -741,10 +739,6 @@ onfi_is_blk_bad(device_t device, uint32_t block_number, uint8_t *bad)
|
||||
chip = device_get_softc(device);
|
||||
|
||||
oob = malloc(chip->chip_geom.oob_size, M_NAND, M_WAITOK);
|
||||
if (!oob) {
|
||||
device_printf(device, "%s: cannot allocate oob\n", __func__);
|
||||
return (ENOMEM);
|
||||
}
|
||||
|
||||
page_number = block_number * chip->chip_geom.pgs_per_blk;
|
||||
*bad = 0;
|
||||
@ -1001,10 +995,6 @@ generic_is_blk_bad(device_t dev, uint32_t block, uint8_t *bad)
|
||||
chip = device_get_softc(dev);
|
||||
|
||||
oob = malloc(chip->chip_geom.oob_size, M_NAND, M_WAITOK);
|
||||
if (!oob) {
|
||||
device_printf(dev, "%s: cannot allocate OOB\n", __func__);
|
||||
return (ENOMEM);
|
||||
}
|
||||
|
||||
page_number = block * chip->chip_geom.pgs_per_blk;
|
||||
*bad = 0;
|
||||
|
@ -90,8 +90,6 @@ nandsim_chip_init(struct nandsim_softc* sc, uint8_t chip_num,
|
||||
int error;
|
||||
|
||||
chip = malloc(sizeof(*chip), M_NANDSIM, M_WAITOK | M_ZERO);
|
||||
if (!chip)
|
||||
return (NULL);
|
||||
|
||||
mtx_init(&chip->ns_lock, "nandsim lock", NULL, MTX_DEF);
|
||||
callout_init(&chip->ns_callout, 1);
|
||||
@ -206,9 +204,6 @@ nandsim_blk_state_init(struct nandsim_chip *chip, uint32_t size,
|
||||
|
||||
chip->blk_state = malloc(size * sizeof(struct nandsim_block_state),
|
||||
M_NANDSIM, M_WAITOK | M_ZERO);
|
||||
if (!chip->blk_state) {
|
||||
return (-1);
|
||||
}
|
||||
|
||||
for (i = 0; i < size; i++) {
|
||||
if (wear_lev)
|
||||
|
Loading…
Reference in New Issue
Block a user