git: 53b79271160c - stable/14 - cmn600: Stop checking for failures from malloc/mallocarray(M_WAITOK)

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

URL: https://cgit.FreeBSD.org/src/commit/?id=53b79271160c36fc060c819a8e34dab86dd00df3

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

    cmn600: Stop checking for failures from malloc/mallocarray(M_WAITOK)
    
    MFC after:      1 week
    Differential Revision:  https://reviews.freebsd.org/D45852
    
    (cherry picked from commit 1d321c1907c210a33192ff5293f5c23554c96867)
---
 sys/arm64/arm64/cmn600.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/sys/arm64/arm64/cmn600.c b/sys/arm64/arm64/cmn600.c
index 7079907e63ce..976c272cc869 100644
--- a/sys/arm64/arm64/cmn600.c
+++ b/sys/arm64/arm64/cmn600.c
@@ -332,9 +332,6 @@ cmn600_create_node(struct cmn600_softc *sc, off_t node_offset,
 	int i;
 
 	node = malloc(sizeof(struct cmn600_node), M_DEVBUF, M_WAITOK);
-	if (node == NULL)
-		return (NULL);
-
 	node->sc = sc;
 	node->nd_offset = node_offset;
 	node->nd_parent = parent;
@@ -399,8 +396,6 @@ cmn600_create_node(struct cmn600_softc *sc, off_t node_offset,
 	node->nd_children = (struct cmn600_node **)mallocarray(
 	    node->nd_child_count, sizeof(struct cmn600_node *), M_DEVBUF,
 	    M_WAITOK);
-	if (node->nd_children == NULL)
-		goto FAIL;
 	for (i = 0; i < node->nd_child_count; i++) {
 		val = node->nd_read8(node, child_offset + (i * 8));
 		node->nd_children[i] = cmn600_create_node(sc, val &
@@ -420,9 +415,6 @@ cmn600_create_node(struct cmn600_softc *sc, off_t node_offset,
 		break;
 	}
 	return (node);
-FAIL:
-	free(node, M_DEVBUF);
-	return (NULL);
 }
 
 static void