git: 7bcb1228558b - main - LinuxKPI: 802.11: Stop checking for failures from malloc(M_WAITOK)

From: Zhenlei Huang <zlei_at_FreeBSD.org>
Date: Tue, 03 Sep 2024 10:26:54 UTC
The branch main has been updated by zlei:

URL: https://cgit.FreeBSD.org/src/commit/?id=7bcb1228558b4325fab39616e2e3b2573a9e7da6

commit 7bcb1228558b4325fab39616e2e3b2573a9e7da6
Author:     Zhenlei Huang <zlei@FreeBSD.org>
AuthorDate: 2024-09-03 10:25:21 +0000
Commit:     Zhenlei Huang <zlei@FreeBSD.org>
CommitDate: 2024-09-03 10:25:21 +0000

    LinuxKPI: 802.11: Stop checking for failures from malloc(M_WAITOK)
    
    As a consequence lkpi_ieee80211_ifalloc() now does not fail. Remove
    unneeded NULL check.
    
    MFC after:      1 week
    Differential Revision:  https://reviews.freebsd.org/D45852
---
 sys/compat/linuxkpi/common/src/linux_80211.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c
index b46e56133725..a2791d20a727 100644
--- a/sys/compat/linuxkpi/common/src/linux_80211.c
+++ b/sys/compat/linuxkpi/common/src/linux_80211.c
@@ -4401,8 +4401,6 @@ lkpi_ieee80211_ifalloc(void)
 	struct ieee80211com *ic;
 
 	ic = malloc(sizeof(*ic), M_LKPI80211, M_WAITOK | M_ZERO);
-	if (ic == NULL)
-		return (NULL);
 
 	/* Setting these happens later when we have device information. */
 	ic->ic_softc = NULL;
@@ -4454,10 +4452,6 @@ linuxkpi_ieee80211_alloc_hw(size_t priv_len, const struct ieee80211_ops *ops)
 
 	/* BSD Specific. */
 	lhw->ic = lkpi_ieee80211_ifalloc();
-	if (lhw->ic == NULL) {
-		ieee80211_free_hw(hw);
-		return (NULL);
-	}
 
 	IMPROVE();