svn commit: r303876 - head/sys/dev/nand
Edward Tomasz Napierala
trasz at FreeBSD.org
Tue Aug 9 15:56:35 UTC 2016
Author: trasz
Date: Tue Aug 9 15:56:33 2016
New Revision: 303876
URL: https://svnweb.freebsd.org/changeset/base/303876
Log:
Remove NULL checks after M_WAITOK allocations from nand(4).
MFC after: 1 month
Modified:
head/sys/dev/nand/nand_generic.c
head/sys/dev/nand/nandsim_chip.c
Modified: head/sys/dev/nand/nand_generic.c
==============================================================================
--- head/sys/dev/nand/nand_generic.c Tue Aug 9 15:55:14 2016 (r303875)
+++ head/sys/dev/nand/nand_generic.c Tue Aug 9 15:56:33 2016 (r303876)
@@ -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_
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_
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;
Modified: head/sys/dev/nand/nandsim_chip.c
==============================================================================
--- head/sys/dev/nand/nandsim_chip.c Tue Aug 9 15:55:14 2016 (r303875)
+++ head/sys/dev/nand/nandsim_chip.c Tue Aug 9 15:56:33 2016 (r303876)
@@ -90,8 +90,6 @@ nandsim_chip_init(struct nandsim_softc*
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_ch
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)
More information about the svn-src-head
mailing list