diff mbox series

nl80211: Remove unreachable code in add_ifidx()

Message ID 20190403121615.4094-2-andrei.otcheretianski@intel.com
State Rejected
Headers show
Series nl80211: Remove unreachable code in add_ifidx() | expand

Commit Message

Otcheretianski, Andrei April 3, 2019, 12:16 p.m. UTC
From: Ilan Peer <ilan.peer@intel.com>

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
---
 src/drivers/driver_nl80211.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

Comments

Jouni Malinen April 28, 2019, 5:54 p.m. UTC | #1
On Wed, Apr 03, 2019 at 03:16:13PM +0300, Andrei Otcheretianski wrote:
> diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
> @@ -6658,12 +6658,7 @@ static void add_ifidx(struct wpa_driver_nl80211_data *drv, int ifidx,
>  		else
>  			drv->if_indices_reason = old_reason;
>  	}
> -	if (!drv->if_indices || !drv->if_indices_reason) {
> -		wpa_printf(MSG_ERROR, "Failed to reallocate memory for "
> -			   "interfaces");
> -		wpa_printf(MSG_ERROR, "Ignoring EAPOL on interface %d", ifidx);
> -		return;
> -	}
> +
>  	if (!old)
>  		os_memcpy(drv->if_indices, drv->default_if_indices,
>  			  sizeof(drv->default_if_indices));

This is hiding the real issue, i.e., the reason why this code became
unreachable. I'll drop this patch and fix that real issue instead.
diff mbox series

Patch

diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index 52cef41865..28d123e570 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -6658,12 +6658,7 @@  static void add_ifidx(struct wpa_driver_nl80211_data *drv, int ifidx,
 		else
 			drv->if_indices_reason = old_reason;
 	}
-	if (!drv->if_indices || !drv->if_indices_reason) {
-		wpa_printf(MSG_ERROR, "Failed to reallocate memory for "
-			   "interfaces");
-		wpa_printf(MSG_ERROR, "Ignoring EAPOL on interface %d", ifidx);
-		return;
-	}
+
 	if (!old)
 		os_memcpy(drv->if_indices, drv->default_if_indices,
 			  sizeof(drv->default_if_indices));