git: 6515ef4d2b42 - stable/14 - flexspi: Stop checking for failures from malloc(M_WAITOK)

From: Zhenlei Huang <zlei_at_FreeBSD.org>
Date: Mon, 30 Sep 2024 04:45:34 UTC
The branch stable/14 has been updated by zlei:

URL: https://cgit.FreeBSD.org/src/commit/?id=6515ef4d2b4251ff4c628577e93b3bd5c1ed480e

commit 6515ef4d2b4251ff4c628577e93b3bd5c1ed480e
Author:     Zhenlei Huang <zlei@FreeBSD.org>
AuthorDate: 2024-09-03 10:25:27 +0000
Commit:     Zhenlei Huang <zlei@FreeBSD.org>
CommitDate: 2024-09-30 04:44:22 +0000

    flexspi: Stop checking for failures from malloc(M_WAITOK)
    
    MFC after:      1 week
    Differential Revision:  https://reviews.freebsd.org/D45852
    
    (cherry picked from commit d1a89bd9b6eb1524902b619fa092c7d6de63e623)
---
 sys/dev/flash/flexspi/flex_spi.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/sys/dev/flash/flexspi/flex_spi.c b/sys/dev/flash/flexspi/flex_spi.c
index 106a7845b2ad..b4c2ce985e08 100644
--- a/sys/dev/flash/flexspi/flex_spi.c
+++ b/sys/dev/flash/flexspi/flex_spi.c
@@ -781,12 +781,6 @@ flex_spi_attach(device_t dev)
 	}
 
 	sc->buf = malloc(sc->erasesize, SECTOR_BUFFER, M_WAITOK);
-	if (sc->buf == NULL) {
-		device_printf(sc->dev, "Unable to set up allocate internal buffer\n");
-		flex_spi_detach(dev);
-		return (ENOMEM);
-	}
-
 	/* Move it to per-flash */
 	sc->disk = disk_alloc();
 	sc->disk->d_open = flex_spi_open;